/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===== Dark Mode Variables ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-tertiary: #374151;
        --border-color: #4b5563;
    }

    /* Override hardcoded colors for dark mode */
    .section-title {
        color: #f9fafb !important;
    }

    .nav-link {
        color: #f9fafb !important;
    }

    .hamburger span {
        background: #f9fafb !important;
    }

    .navbar {
        background: rgba(31, 41, 55, 0.98) !important;
    }

    .navbar.scrolled {
        background: rgba(31, 41, 55, 1) !important;
    }

    .about-intro,
    .info-item strong,
    .languages h3,
    .language-header,
    .timeline-header h3,
    .education-card h3,
    .skill-category h3,
    .contact-info h3,
    .contact-item strong {
        color: #f9fafb !important;
    }

    .about-description,
    .info-item div,
    .timeline-description li,
    .skill-category p,
    .contact-item p {
        color: #d1d5db !important;
    }

    .language-level,
    .period {
        color: #9ca3af !important;
        background: #374151 !important;
    }

    .company,
    .institution,
    .contact-item a {
        color: #60a5fa !important;
    }

    .timeline-description li::before {
        color: #60a5fa !important;
    }

    .about-text {
        background: #374151 !important;
        border: 1px solid #4b5563 !important;
    }

    .timeline-content,
    .contact-info,
    .contact-form-container {
        background: #1f2937 !important;
    }

    .education-card,
    .skill-category {
        background: #374151 !important;
        border: 1px solid #4b5563 !important;
    }

    .nav-menu {
        background: rgba(31, 41, 55, 0.98) !important;
    }

    .nav-menu li a {
        color: #f9fafb !important;
    }

    .profile-placeholder {
        border-color: #374151 !important;
    }

    .form-group input,
    .form-group textarea {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }

    .form-group label {
        background: #1f2937 !important;
        color: #9ca3af !important;
    }

    .form-group input:focus + label,
    .form-group input:not(:placeholder-shown) + label,
    .form-group textarea:focus + label,
    .form-group textarea:not(:placeholder-shown) + label {
        color: #60a5fa !important;
    }

    .lang-btn {
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }

    .lang-btn:hover {
        border-color: #60a5fa !important;
        color: #60a5fa !important;
    }

    .lang-btn.active {
        background: #60a5fa !important;
        color: #111827 !important;
        border-color: #60a5fa !important;
    }
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

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

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

/* ===== Loading Screen ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-content p {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-lg);
}

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

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #1f2937;
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

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

.language-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e5e7eb;
    background: transparent;
    color: #1f2937;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.lang-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #1f2937;
    transition: var(--transition);
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 2rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    display: inline-block;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.profile-card {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image-container {
    position: relative;
    width: 350px;
    height: 350px;
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.profile-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 700;
    color: white;
    border: 5px solid white;
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

.profile-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.scroll-indicator span {
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 3px;
    animation: scroll-animation 1.5s ease-in-out infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scroll-animation {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 1s ease-in;
}

.fade-in-delay {
    animation: fadeIn 1s ease-in 0.3s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Section Styles ===== */
.section {
    padding: 5rem 2rem;
}

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

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: #111827;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-secondary);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.about-intro {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #111827;
    font-weight: 500;
}

.about-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 2rem;
}

.about-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    align-items: start;
}

.info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    color: #111827;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.info-item div {
    color: #374151;
}

.info-item a {
    color: var(--primary-color);
}

.info-item a:hover {
    text-decoration: underline;
}

.languages h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #111827;
    font-weight: 700;
}

.language-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.language-item {
    width: 100%;
}

.language-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #111827;
}

.language-level {
    color: #4b5563;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 1s ease;
    width: 0;
}

.progress-fill.animated {
    width: attr(data-width);
}

/* ===== Experience Section ===== */
.experience {
    background: var(--bg-primary);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: 19px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 4px solid var(--primary-color);
    z-index: 1;
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-header h3 {
    font-size: 1.5rem;
    color: #111827;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.company {
    display: block;
    color: #1d4ed8;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.period {
    display: inline-block;
    color: #4b5563;
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    background: #e5e7eb;
    border-radius: 20px;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-current {
    background: var(--secondary-color);
    color: white;
}

.timeline-description {
    list-style: none;
    padding-left: 0;
}

.timeline-description li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    color: #374151;
    line-height: 1.6;
}

.timeline-description li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #1d4ed8;
    font-weight: bold;
}

/* ===== Education Section ===== */
.education {
    background: var(--bg-secondary);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.education-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.education-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.education-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.education-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111827;
    min-height: 60px;
    font-weight: 700;
}

.institution {
    color: #1d4ed8;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.education-card .period {
    background: #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

/* ===== Skills Section ===== */
.skills {
    background: var(--bg-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #111827;
    font-weight: 700;
}

.skill-category p {
    color: #374151;
    line-height: 1.6;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    height: fit-content;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #111827;
    font-weight: 700;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #111827;
    font-weight: 600;
}

.contact-item p {
    color: #374151;
    margin: 0;
}

.contact-item a {
    color: #1d4ed8;
    font-weight: 500;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
    background: white;
    padding: 0 0.5rem;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-response {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    display: none;
}

.form-response.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.form-response.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* ===== Footer ===== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem;
    text-align: center;
}

.footer p {
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ===== AOS Animations ===== */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.6s;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .profile-image-container {
        width: 280px;
        height: 280px;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu li a {
        color: #1f2937;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .language-selector {
        position: absolute;
        top: 1rem;
        right: 4rem;
    }

    .lang-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-marker {
        left: 9px;
    }

    .timeline-item {
        padding-left: 60px;
    }
}

@media (max-width: 640px) {
    .section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .about-text {
        padding: 1.5rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .timeline-header h3 {
        font-size: 1.2rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .hero,
    .back-to-top,
    .loader,
    .contact-form-container {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}
