/* ===== Reset & Base Styles ===== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
scroll-behavior: smooth;
}

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
background: #0a0a0f;
color: #e4e4e7;
overflow-x: hidden;
}

/* ===== Navigation ===== */
nav {
position: fixed;
top: 0;
width: 100%;
background: rgba(10, 10, 15, 0.95);
backdrop-filter: blur(10px);
z-index: 1000;
padding: 1rem 0;
transition: all 0.3s ease;
}

nav.scrolled {
background: rgba(10, 10, 15, 0.98);
box-shadow: 0 2px 20px rgba(168, 85, 247, 0.1);
}

nav .container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
}

.logo {
font-size: 1.5rem;
font-weight: bold;
background: linear-gradient(135deg, #a855f7, #ec4899);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.nav-links {
display: flex;
list-style: none;
gap: 2rem;
}

.nav-links a {
color: #e4e4e7;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
position: relative;
}

.nav-links a:hover {
color: #a855f7;
}

.nav-links a::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: -5px;
left: 0;
background: linear-gradient(135deg, #a855f7, #ec4899);
transition: width 0.3s ease;
}

.nav-links a:hover::after {
width: 100%;
}

/* ===== General Containers ===== */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
}

section {
padding: 6rem 0;
}

h1, h2, h3 {
margin-bottom: 1rem;
color: #ffffff;
}

/* ===== Hero Section ===== */
#hero {
min-height: 100vh;
display: flex;
align-items: center;
background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
position: relative;
overflow: hidden;
}

#hero::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: 
    radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.hero-content {
position: relative;
z-index: 2;
text-align: center;
}

.hero-title {
font-size: clamp(2.5rem, 8vw, 4.5rem);
font-weight: 700;
margin-bottom: 1rem;
opacity: 0;
animation: fadeInUp 1s ease 0.2s forwards;
}

.hero-title span {
background: linear-gradient(135deg, #a855f7, #ec4899, #f59e0b);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.hero-subtitle {
font-size: 1.3rem;
color: #71717a;
margin-bottom: 2rem;
opacity: 0;
animation: fadeInUp 1s ease 0.4s forwards;
}

.hero-subtitle span {
font-style: italic;
font-weight: 600;
}

.hero-description {
font-size: 1.1rem;
color: #a1a1aa;
max-width: 600px;
margin: 0 auto 3rem;
opacity: 0;
animation: fadeInUp 1s ease 0.6s forwards;
}

.hero-typing {
font-weight: bold;
}

#typing-word::after {
content: "|";
margin-left: 4px;
animation: blink 0.8s infinite;
color: #ec4899;
}

.hero-btn {
display: inline-block;
padding: 1rem 2rem;
background: linear-gradient(135deg, #a855f7, #ec4899);
color: white;
text-decoration: none;
border-radius: 50px;
font-weight: 600;
transition: all 0.3s ease;
opacity: 0;
animation: fadeInUp 1s ease 0.8s forwards;
box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.hero-btn:hover {
transform: translateY(-3px);
box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

/* ===== Floating Elements ===== */
.floating-shapes {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
}

.shape {
position: absolute;
opacity: 0.1;
animation: float 6s ease-in-out infinite;
}

.shape:nth-child(1) {
top: 20%;
left: 10%;
animation-delay: 0s;
}

.shape:nth-child(2) {
top: 60%;
right: 10%;
animation-delay: 2s;
}

.shape:nth-child(3) {
bottom: 20%;
left: 20%;
animation-delay: 4s;
}

/* ===== About Section ===== */
#about {
background: #0f0f14;
position: relative;
}

.about-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4rem;
align-items: center;
}

.about-text h2 {
font-size: 2.5rem;
margin-bottom: 1.5rem;
background: linear-gradient(135deg, #a855f7, #ec4899);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.about-text p {
font-size: 1.1rem;
color: #a1a1aa;
margin-bottom: 1.5rem;
line-height: 1.8;
}

.about-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
margin-top: 2rem;
}

.stat-item {
text-align: center;
padding: 1rem;
background: rgba(168, 85, 247, 0.1);
border-radius: 10px;
backdrop-filter: blur(10px);
}

.stat-number {
font-size: 2rem;
font-weight: bold;
color: #a855f7;
display: block;
}

.stat-text {
font-size: 2rem;
font-weight: bold;
color: #a855f7;
display: block;
}

.stat-label {
color: #a1a1aa;
font-size: 0.9rem;
}

/* ===== Skills Section ===== */
#skills {
background: #0a0a0f;
text-align: center;
}

.skills-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 2rem;
margin-top: 3rem;
}

.skill-card {
background: rgba(15, 15, 20, 0.8);
padding: 2rem 1rem;
border-radius: 15px;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(168, 85, 247, 0.1);
position: relative;
overflow: hidden;
}

.skill-card::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.1), transparent);
transition: left 0.5s ease;
}

.skill-card:hover::before {
left: 100%;
}

.skill-card:hover {
transform: translateY(-10px);
border-color: rgba(168, 85, 247, 0.3);
box-shadow: 0 10px 30px rgba(168, 85, 247, 0.2);
}

.skill-card i {
margin-bottom: 1rem;
display: block;
}

.skill-card p {
font-weight: 600;
color: #e4e4e7;
}

/* ===== Services Section ===== */
#services {
background: #0f0f14;
text-align: center;
}

.services-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin-top: 3rem;
}

.service-card {
background: rgba(15, 15, 20, 0.8);
padding: 2.5rem;
border-radius: 15px;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(168, 85, 247, 0.1);
position: relative;
overflow: hidden;
}

.service-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: linear-gradient(135deg, #a855f7, #ec4899);
transform: scaleX(0);
transition: transform 0.3s ease;
}

.service-card:hover::before {
transform: scaleX(1);
}

.service-card:hover {
transform: translateY(-10px);
border-color: rgba(168, 85, 247, 0.3);
box-shadow: 0 15px 40px rgba(168, 85, 247, 0.15);
}

.service-icon {
width: 60px;
height: 60px;
margin: 0 auto 1.5rem;
background: linear-gradient(135deg, #a855f7, #ec4899);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
color: white;
}

.service-card h3 {
font-size: 1.3rem;
margin-bottom: 1rem;
color: #ffffff;
}

.service-card p {
color: #a1a1aa;
line-height: 1.7;
}

/* ===== Projects Section ===== */
#projects {
background: #0a0a0f;
text-align: center;
}

.project-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 2rem;
margin-top: 3rem;
}

.project-card {
background: rgba(15, 15, 20, 0.8);
border-radius: 15px;
overflow: hidden;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(168, 85, 247, 0.1);
position: relative;
}

.project-card:hover {
transform: translateY(-10px);
box-shadow: 0 20px 40px rgba(168, 85, 247, 0.2);
}

.project-image {
width: 100%;
height: 200px;
background: linear-gradient(135deg, #a855f7, #ec4899);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 3rem;
position: relative;
overflow: hidden;
}

.project-image::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.5s ease;
}

.project-card:hover .project-image::before {
left: 100%;
}

.project-content {
padding: 2rem;
text-align: left;
}

.project-content h3 {
font-size: 1.3rem;
margin-bottom: 1rem;
color: #ffffff;
}

.project-content p {
color: #a1a1aa;
margin-bottom: 1.5rem;
line-height: 1.6;
}

.project-links {
display: flex;
gap: 1rem;
}

.project-link {
padding: 0.5rem 1rem;
background: rgba(168, 85, 247, 0.2);
color: #a855f7;
text-decoration: none;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 500;
transition: all 0.3s ease;
border: 1px solid rgba(168, 85, 247, 0.3);
}

.project-link:hover {
background: #a855f7;
color: white;
transform: translateY(-2px);
}

.project-prev-not-available {
padding: 0.5rem 1rem;
background: rgba(247, 85, 85, 0.2);
color: #ff5526;
text-decoration: none;
border-radius: 20px;
font-size: 0.9rem;
font-weight: 500;
transition: all 0.3s ease;
border: 1px solid rgba(247, 99, 85, 0.3);
}

.project-prev-not-available:hover {
background: #fe4039;
color: white;
transform: translateY(-2px);
}

/* ===== Game Popup ===== */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(5px);
}

.modal-content {
position: relative;
background-color: #1a1a1a;
margin: 2% auto;
padding: 0;
border: none;
border-radius: 15px;
width: 90%;
height: 90%;
max-width: 1200px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
overflow: hidden;
}

.modal-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 15px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}

.modal-title {
color: white;
margin: 0;
font-size: 1.2rem;
font-weight: 600;
}

.close-btn {
background: none;
border: none;
color: white;
font-size: 24px;
cursor: pointer;
padding: 5px;
border-radius: 50%;
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease;
}

.close-btn:hover {
background-color: rgba(255, 255, 255, 0.2);
}

.modal-iframe {
width: 100%;
height: calc(100% - 60px);
border: none;
background: white;
}

/* ===== Contact Section ===== */
#contact {
background: #0f0f14;
text-align: center;
}

.contact-content {
max-width: 600px;
margin: 0 auto;
}

.contact-info {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-top: 3rem;
}

.contact-item {
background: rgba(15, 15, 20, 0.8);
padding: 2rem;
border-radius: 15px;
backdrop-filter: blur(10px);
border: 1px solid rgba(168, 85, 247, 0.1);
transition: all 0.3s ease;
}

.contact-item:hover {
transform: translateY(-5px);
border-color: rgba(168, 85, 247, 0.3);
}

.contact-item a {
color: #f0f0f0;
text-decoration: none;
}

.contact-item a:hover {
color: #a855f7;
}

.contact-icon {
width: 50px;
height: 50px;
margin: 0 auto 1rem;
background: linear-gradient(135deg, #a855f7, #ec4899);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
color: white;
}

.social-links {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 2rem;
}

.social-link {
width: 50px;
height: 50px;
background: rgba(168, 85, 247, 0.2);
color: #a855f7;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
transition: all 0.3s ease;
border: 1px solid rgba(168, 85, 247, 0.3);
}

.social-link:hover {
background: #a855f7;
color: white;
transform: translateY(-3px);
}

.ttt-cell.winning-line {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border-color: #10b981 !important;
    animation: winningPulse 0.5s ease-in-out;
}

/* Disabled state for cells during bot turn */
.ttt-cell[style*="pointer-events: none"] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Better current turn indicator */
.player.current-turn {
    background: rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    animation: currentTurnPulse 2s infinite;
}

@keyframes currentTurnPulse {
    0%, 100% { 
        background: rgba(168, 85, 247, 0.2);
        transform: scale(1);
    }
    50% { 
        background: rgba(168, 85, 247, 0.3);
        transform: scale(1.02);
    }
}

/* Bot thinking indicator */
#tttStatus {
    transition: all 0.3s ease;
}

/* ===== Footer ===== */
footer {
background: #0a0a0f;
color: #71717a;
text-align: center;
padding: 2rem 0;
border-top: 1px solid rgba(168, 85, 247, 0.1);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
from {
    opacity: 0;
    transform: translateY(30px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}

@keyframes winningPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes float {
0%, 100% {
    transform: translateY(0px) rotate(0deg);
}
50% {
    transform: translateY(-20px) rotate(180deg);
}
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
.nav-links {
    display: none;
}

.about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
}

.about-stats {
    grid-template-columns: repeat(2, 1fr);
}

.skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.services-grid,
.project-grid {
    grid-template-columns: 1fr;
}

.modal-content {
width: 95%;
height: 95%;
margin: 2.5% auto;
}

.modal-title {
font-size: 1rem;
}

.contact-info {
    grid-template-columns: 1fr;
}
}

@media (max-width: 480px) {
.container {
    padding: 0 1rem;
}

.hero-title {
    font-size: 2rem;
}

.about-stats {
    grid-template-columns: 1fr;
}

.skills-grid {
    grid-template-columns: repeat(2, 1fr);
}
}

/* ===== Scroll Progress Bar ===== */
.progress-bar {
position: fixed;
top: 0;
left: 0;
width: 0%;
height: 3px;
background: linear-gradient(135deg, #a855f7, #ec4899);
z-index: 9999;
transition: width 0.1s ease;
}

/* ===== Section Titles ===== */
.section-title {
font-size: 2.5rem;
text-align: center;
margin-bottom: 3rem;
background: linear-gradient(135deg, #a855f7, #ec4899);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

/* Mobile Menu Toggle */
.menu-toggle {
display: none;
flex-direction: column;
cursor: pointer;
font-size: 1.5rem;
color: #e4e4e7;
z-index: 1001;
}

/* Mobile Menu Styles */
.menu-toggle {
    display: none;
    color: #e4e4e7;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.menu-toggle:hover {
    color: #a855f7;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Navigation */
    .menu-toggle {
        display: block;
    }

    /* Fix: hide nav by default, only show when .mobile-open is active */
    .nav-links {
        display: none; /* hidden initially */
        position: fixed;
        top: 70px;
        right: -100%;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(10px);
        width: 250px;
        height: auto;
        max-height: calc(100vh - 70px);
        flex-direction: column;
        padding: 1rem 0;
        transition: right 0.3s ease;
        border-radius: 0 0 0 15px;
        box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-links.mobile-open {
        display: flex; /* show when open */
        right: 0;
    }

    .nav-links li {
        margin: 0.5rem 0;
        text-align: center;
    }


    .nav-links a {
        display: block;
        transition: all 0.3s ease;
        padding: 0.75rem 1rem;
        margin: 0 0.5rem;
        border-radius: 6px;
    }

    .nav-links a:hover {
        background: rgba(168, 85, 247, 0.1);
        transform: translateX(-5px);
    }

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Skills Grid */
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .skill-card i {
        font-size: 2rem !important;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Projects Grid */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Contact Section */
    .contact-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    /* Footer */
    footer p {
        font-size: 0.9rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .container {
        padding: 0 0.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 1rem;
    }

    .service-card,
    .project-card {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .nav-links {
        width: 200px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-links {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
}

/* Enhanced Animations */
.loaded {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Additional hover effects */
.social-link:hover {
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.project-link:hover {
    box-shadow: 0 3px 10px rgba(168, 85, 247, 0.2);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
    }
    40% {
    transform: translateY(-10px) translateX(-50%);
    }
    60% {
    transform: translateY(-5px) translateX(-50%);
    }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}