/* ========================================
   CV Styles - Modern & Professional
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #475569;
    --color-accent: #0ea5e9;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;

    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-sidebar: #1e293b;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-muted: #94a3b8;
    --color-text-sidebar: #f1f5f9;
    --color-text-sidebar-muted: #94a3b8;

    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: auto;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Container */
.cv-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
    background: var(--color-bg);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    background: var(--color-bg-sidebar);
    color: var(--color-text-sidebar);
    padding: var(--space-8) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

/* Profile Section */
.profile-section {
    text-align: center;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    color: white;
}

.name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
    color: var(--color-text-sidebar);
}

.title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Titles in Sidebar */
.section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary-light);
    margin-bottom: var(--space-4);
    position: relative;
    padding-bottom: var(--space-2);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

/* Contact Info */
.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.contact-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    margin-top: 2px;
}

.contact-link {
    color: var(--color-text-sidebar);
    word-break: break-word;
    transition: color var(--transition-fast);
}

.contact-link:hover {
    color: var(--color-primary-light);
}

/* Skills */
.skills-category {
    margin-bottom: var(--space-5);
}

.skill-category-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-sidebar);
    margin-bottom: var(--space-3);
}

.skills-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.skill-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-sidebar);
}

.skill-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

/* Skill Tags */
.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.skill-tag {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: var(--space-1) var(--space-2);
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-primary-light);
    border-radius: var(--radius-full);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

/* Languages */
.languages-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.language-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.language-level {
    font-size: var(--font-size-xs);
    color: var(--color-text-sidebar-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    padding: var(--space-8) var(--space-10);
    max-width: calc(1000px - var(--sidebar-width));
}

.section {
    margin-bottom: var(--space-10);
}

.section:last-of-type {
    margin-bottom: var(--space-6);
}

.section-heading {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
    letter-spacing: -0.01em;
}

/* Objective */
.objective-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-secondary);
    text-align: justify;
}

/* Experience */
.experience-item {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border-light);
}

.experience-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.experience-meta {
    flex: 1;
    min-width: 200px;
}

.position {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.company {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.experience-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
    text-align: right;
    white-space: nowrap;
}

.date {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
}

.location {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.achievements {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-left: var(--space-4);
    border-left: 2px solid var(--color-primary-light);
}

.achievements li {
    position: relative;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    color: var(--color-secondary);
    padding-left: var(--space-3);
}

.achievements li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    transform: translateX(-50%);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Tech Tags */
.tech-tag {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg-alt);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.tech-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Projects */
.project-item {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-normal);
}

.project-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.project-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.project-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.project-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    color: var(--color-secondary);
    margin-bottom: var(--space-3);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.project-links {
    display: flex;
    gap: var(--space-3);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.project-link:hover {
    background: var(--color-primary);
    color: white;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

/* Education */
.education-item {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
}

.education-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.education-meta {
    flex: 1;
    min-width: 200px;
}

.degree {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.school {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.education-date {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
    white-space: nowrap;
}

.education-details {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

/* Awards */
.awards-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.award-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-normal);
}

.award-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
}

.award-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.award-date {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.award-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin: 0;
}

/* Footer */
.cv-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-4);
    background: var(--color-bg-sidebar);
    color: var(--color-text-sidebar-muted);
    font-size: var(--font-size-xs);
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    @page {
        margin: 0;
        size: A4;
    }

    .cv-container {
        display: block;
        max-width: none;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        max-width: none;
        padding: 0;
    }

    .section {
        page-break-inside: avoid;
        margin-bottom: var(--space-6);
    }

    .experience-item,
    .project-item,
    .education-item {
        page-break-inside: avoid;
    }

    .cv-footer {
        display: none;
    }

    a {
        color: var(--color-text) !important;
        text-decoration: none !important;
    }

    .tech-tag,
    .skill-tag {
        border-color: var(--color-border) !important;
        color: var(--color-text) !important;
        background: var(--color-bg-alt) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .cv-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .sidebar {
        padding: var(--space-6) var(--space-4);
        border-bottom: 1px solid var(--color-border);
    }

    .sidebar::before {
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
    }

    .profile-section {
        padding-bottom: var(--space-4);
    }

    .profile-photo {
        width: 80px;
        height: 80px;
    }

    .avatar-placeholder {
        width: 50px;
        height: 50px;
    }

    .name {
        font-size: var(--font-size-lg);
    }

    .main-content {
        max-width: 100%;
        padding: var(--space-6) var(--space-4);
    }

    .section-heading {
        font-size: var(--font-size-base);
    }

    .experience-header,
    .education-header,
    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-date,
    .education-date,
    .project-date {
        align-items: flex-start;
        text-align: left;
        margin-top: var(--space-2);
    }

    .achievements {
        padding-left: var(--space-3);
    }

    .achievements li::before {
        left: -5px;
        width: 5px;
        height: 5px;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 0.875rem;
        --space-8: 1.5rem;
        --space-10: 2rem;
    }

    .sidebar {
        padding: var(--space-5) var(--space-3);
    }

    .main-content {
        padding: var(--space-5) var(--space-3);
    }

    .contact-item {
        font-size: var(--font-size-xs);
    }

    .skill-name,
    .language-name {
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --color-primary: #1d4ed8;
        --color-border: #000;
        --color-text: #000;
        --color-secondary: #333;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
}