/* Theme Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #8B5CF6, #06B6D4);
    --purple-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Dark Theme Variables (Default) */
:root[data-theme="dark"],
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-secondary: rgba(26, 26, 46, 0.95);
    --bg-header: rgba(26, 26, 46, 0.95);
    --bg-section: rgba(139, 92, 246, 0.05);
    --bg-footer: rgba(26, 26, 46, 0.8);
    --bg-card: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --border-color: rgba(139, 92, 246, 0.2);
    --shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    --shadow-hover: 0 8px 30px rgba(139, 92, 246, 0.4);
}

/* Light Theme Variables */
:root[data-theme="light"],
[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-section: rgba(139, 92, 246, 0.02);
    --bg-footer: rgba(248, 250, 252, 0.9);
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1a202c;
    --text-secondary: rgba(74, 85, 104, 0.8);
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
    --shadow-hover: 0 8px 30px rgba(139, 92, 246, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mobile-First Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

/* Scrolled navbar with better transparency */
.navbar.scrolled {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(25px);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 6px;
    object-fit: contain;
}

.nav-logo span {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile menu hidden by default */
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1rem;
    z-index: 999;
}

.nav-menu.active {
    display: flex;
}


.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nav-link:hover,
.nav-link.active {
    color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1001;
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: #8B5CF6;
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
    background: #8B5CF6;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 1rem;
}

.theme-toggle:hover {
    background: var(--bg-section);
    border-color: #8B5CF6;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: all 0.3s ease;
}

/* Show sun icon for dark theme, moon for light theme */
[data-theme="dark"] .theme-toggle .sun-icon,
:root:not([data-theme]) .theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-toggle .moon-icon,
:root:not([data-theme]) .theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Mobile-First Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 120px 1rem 2rem;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.hero-content {
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 600px;
}

.cta-button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Mobile-First Hero Visual */
.hero-visual {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-element {
    width: 250px;
    height: 150px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3));
    border-radius: 20px;
    position: absolute;
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    position: absolute;
    right: 20px;
}

.grid-item {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    animation: pulse 2s ease-in-out infinite;
}

.grid-item.active {
    background: var(--primary-gradient);
    box-shadow: var(--shadow);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Mobile-First Projects Section */
.projects {
    padding: 4rem 1rem;
    background: var(--bg-section);
}

.projects-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
}

/* Mobile-first: Single column layout */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-height: 44px;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(139, 92, 246, 0.5);
}

.project-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(6, 182, 212, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-icon {
    color: white;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.project-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8B5CF6;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.project-card:hover .project-link {
    color: #06B6D4;
}

/* Mobile-First Features Section */
.features {
    padding: 4rem 1rem;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.feature-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Mobile-First Footer */
.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section h3 {
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.25rem 0;
    display: block;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.footer-section ul li a:hover {
    color: #8B5CF6;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tablet and Desktop Responsive Design */

/* Tablet: 768px and up */
@media (min-width: 768px) {
    .nav-container {
        padding: 0 2rem;
    }
    
    /* Ensure proper tablet hero padding */
    .hero {
        padding: 120px 2rem 2rem;
    }
    
    .nav-logo img {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .nav-logo span {
        font-size: 1.4rem;
    }
    
    .nav-menu {
        display: flex;
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        flex-direction: row;
        justify-content: flex-end;
        gap: 1.5rem;
        left: auto;
        transition: none;
        backdrop-filter: none;
        border-top: none;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .hero {
        padding: 100px 2rem 2rem;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        text-align: left;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-description {
        font-size: 1.2rem;
    }
    
    .hero-visual {
        height: 400px;
    }
    
    .floating-element {
        width: 280px;
        height: 180px;
    }
    
    .tech-grid {
        gap: 0.75rem;
        right: 0;
    }
    
    .grid-item {
        width: 50px;
        height: 50px;
    }
    
    .projects {
        padding: 5rem 2rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 1.2rem;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-content {
        padding: 2rem;
    }
    
    .project-title {
        font-size: 1.4rem;
    }
    
    .project-description {
        font-size: 1rem;
    }
    
    .features {
        padding: 5rem 2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .feature-item {
        padding: 2rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        border-radius: 15px;
        margin-bottom: 1.5rem;
    }
    
    .feature-item h3 {
        font-size: 1.2rem;
    }
    
    .feature-item p {
        font-size: 1rem;
    }
    
    .footer {
        padding: 3rem 2rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
    .nav-logo img {
        width: 60px;
        height: 60px;
        margin-right: 15px;
    }
    
    .nav-logo span {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 2rem;
    }
    
    /* Fix desktop content overlap with topbar */
    .hero {
        padding: 140px 2rem 2rem;
    }
    
    .hero-container {
        gap: 4rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        text-align: left;
    }
    
    .hero-title {
        font-size: 4rem;
        /* Make blue/gradient text more prominent */
        background: linear-gradient(135deg, #1e40af, #3b82f6, #06b6d4);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 900;
        text-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
    }
    
    .hero-description {
        font-size: 1.25rem;
    }
    
    .hero-visual {
        height: 500px;
    }
    
    .floating-element {
        width: 300px;
        height: 200px;
    }
    
    .tech-grid {
        gap: 1rem;
    }
    
    .grid-item {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }
    
    .projects {
        padding: 6rem 2rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .section-subtitle {
        font-size: 1.25rem;
        margin-bottom: 4rem;
    }
    
    /* Desktop: 3 columns for products */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .project-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
    }
    
    /* Enhance hover overlay visibility */
    .project-overlay {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(6, 182, 212, 0.9));
    }
    
    .project-card:hover .project-overlay {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
    
    .project-icon {
        color: white;
        font-size: 2rem;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
    
    .project-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .project-description {
        margin-bottom: 1.5rem;
    }
    
    .project-tags {
        margin-bottom: 1.5rem;
    }
    
    .features {
        padding: 6rem 2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        margin-top: 4rem;
    }
    
    .feature-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
    }
    
    .feature-item h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop: 1440px and up */
@media (min-width: 1440px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .project-card {
        max-width: none;
    }
}