/* Base styles and variables */
:root {
    /* Light Theme Colors */
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --primary: #0984e3;
    --secondary: #6c5ce7;
    --accent: #00b894;
    --border: #dfe6e9;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #f353eb, #5ce79f);
    --text-gradient: linear-gradient(135deg, #2d3436, #0984e3);
    --heading-gradient: linear-gradient(135deg, #0984e3, #6c5ce7);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(245, 247, 250, 0.8);
    --nav-shadow: rgba(0, 0, 0, 0.05);
    --section-padding: 5rem 2rem;
    --container-width: 1280px;
    --border-radius: 0.75rem;
    --nav-height: 70px;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg: #1a1a1a;
    --card-bg: #2d2d2d;
    --text: #ffffff;
    --text-light: #b2bec3;
    --primary: #74b9ff;
    --secondary: #dff37e;
    --accent: #00cec9;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(135deg, #64abee, #ee7381);
    --text-gradient: linear-gradient(135deg, #ffffff, #74b9ff);
    --heading-gradient: linear-gradient(135deg, #74b9ff, #a29bfe);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(26, 26, 26, 0.8);
    --nav-shadow: rgba(0, 0, 0, 0.2);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(135deg, #e0f7fa, #e8f5e9);
    transition: var(--transition);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

[data-theme="dark"] body {
    background: var(--bg);
}

/* Main content */
#content {
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Error message */
.error-message {
    padding: 2rem;
    margin: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text);
    text-align: center;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section styles */
section {
    padding: var(--section-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, var(--primary-light) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, var(--accent) 0%, transparent 60%);
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

/* Hero section specific background */
#home::before {
    background:
        radial-gradient(circle at 85% 15%, var(--primary-light) 0%, transparent 70%),
        radial-gradient(circle at 15% 85%, var(--accent) 0%, transparent 70%);
    opacity: 0.1;
}

/* Projects section specific background */
#projects::before {
    background:
        radial-gradient(circle at 75% 25%, var(--primary-light) 0%, transparent 65%),
        radial-gradient(circle at 25% 75%, var(--accent) 0%, transparent 65%);
    opacity: 0.08;
}

/* Experience section specific background */
#experience::before {
    background:
        radial-gradient(circle at 70% 30%, var(--primary-light) 0%, transparent 60%),
        radial-gradient(circle at 30% 70%, var(--accent) 0%, transparent 60%);
    opacity: 0.08;
}

/* Awards section specific background */
#awards::before {
    background:
        radial-gradient(circle at 65% 35%, var(--primary-light) 0%, transparent 55%),
        radial-gradient(circle at 35% 65%, var(--accent) 0%, transparent 55%);
    opacity: 0.08;
}

/* Contact section specific background */
#contact::before {
    background:
        radial-gradient(circle at 60% 40%, var(--primary-light) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, var(--accent) 0%, transparent 50%);
    opacity: 0.08;
}

/* Dark theme adjustments */
[data-theme="dark"] section::before {
    opacity: 0.15;
}

[data-theme="dark"] #home::before {
    opacity: 0.2;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h1 {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--container-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.3s ease;
}

.navbar .logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
}

.download-cv {
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.download-cv:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
    color: white;
}

.download-cv::after {
    display: none;
}


.theme-toggle-container {
    position: relative;
    margin-left: 1rem;
    display: flex;
    align-items: center;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.theme-toggle i {
    font-size: 1.25rem;
    color: var(--text);
    transition: var(--transition);
}

.light-icon {
    position: absolute;
    opacity: 1;
    transform: translateY(0);
}

.dark-icon {
    position: absolute;
    opacity: 0;
    transform: translateY(20px);
}

[data-theme="dark"] .light-icon {
    opacity: 0;
    transform: translateY(-20px);
}

[data-theme="dark"] .dark-icon {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}


@media (min-width: 1440px) {
    :root {
        --container-width: 1400px;
    }
}

/* Desktops (1200px to 1439px) */
@media (max-width: 1439px) {
    :root {
        --container-width: 1200px;
    }
}

/* Small Desktops and Large Tablets (1024px to 1199px) */
@media (max-width: 1199px) {
    :root {
        --container-width: 1000px;
        --section-padding: 4.5rem 2rem;
    }

    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }

    .nav-container {
        padding: 0 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .theme-toggle {
        margin-left: 1rem;
    }
}

/* Tablets (768px to 1023px) */
@media (max-width: 1023px) {
    :root {
        --container-width: 900px;
        --section-padding: 4rem 1.5rem;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .nav-container {
        padding: 0 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .theme-toggle {
        margin-left: 0.75rem;
    }

    /* Fix image aspect ratio */
    img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .profile-img {
        width: 250px;
        height: 250px;
        border-radius: 50%;
        object-fit: cover;
    }
}

/* Large Mobile Devices (576px to 767px) */
@media (max-width: 767px) {
    :root {
        --container-width: 100%;
        --section-padding: 3.5rem 1.5rem;
        --nav-height: 65px;
    }

    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .nav-container {
        padding: 0 1rem;
        position: relative;
    }

    .nav-links {
        gap: 1.25rem;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1.1rem;
    }

    .theme-toggle {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }

    .profile-img {
        width: 200px;
        height: 200px;
    }

    /* Fix navigation layout */
    .navbar {
        height: auto;
        min-height: var(--nav-height);
    }

    .nav-container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* Medium Mobile Devices (425px to 575px) */
@media (max-width: 575px) {
    :root {
        --section-padding: 3rem 1rem;
        --nav-height: 60px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .nav-container {
        padding: 0 0.75rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        right: 0.75rem;
    }

    .theme-toggle i {
        font-size: 1rem;
    }

    .profile-img {
        width: 180px;
        height: 180px;
    }
}

/* Small Mobile Devices (320px to 424px) */
@media (max-width: 424px) {
    :root {
        --section-padding: 2.5rem 0.75rem;
        --nav-height: 55px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

    .nav-container {
        padding: 0 0.5rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .logo {
        font-size: 0.9rem;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
        right: 0.5rem;
    }

    .theme-toggle i {
        font-size: 0.9rem;
    }

    .profile-img {
        width: 160px;
        height: 160px;
    }
}

/* Extra Small Mobile Devices (below 320px) */
@media (max-width: 319px) {
    :root {
        --section-padding: 2rem 0.5rem;
        --nav-height: 50px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    .nav-container {
        padding: 0 0.25rem;
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .logo {
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 28px;
        height: 28px;
        right: 0.25rem;
    }

    .theme-toggle i {
        font-size: 0.8rem;
    }

    .profile-img {
        width: 140px;
        height: 140px;
    }
}

/* Landscape Mode for Tablets and Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    :root {
        --section-padding: 3rem 2rem;
    }

    .navbar {
        height: 60px;
    }

    .nav-links {
        margin-top: 0;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        font-weight: 600;
    }

    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: none;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    section {
        padding: 2rem 0;
        min-height: auto;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-nav-toggle i {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--nav-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
    }

    .theme-toggle-container {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-links {
        padding: 1.5rem;
    }

    .nav-link {
        font-size: 1.1rem;
    }
}
