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

/* Default theme variables - will be overridden by theme system */
:root, [data-theme="default"] {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --header-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #f3f4f6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

/* Resume Container */
.resume {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    overflow: hidden;
}

/* Header Section */
.header {
    background: var(--header-gradient);
    color: white;
    padding: 2.5rem 2rem 2rem;
    position: relative;
}

.header-content {
    text-align: center;
}

.name {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

/* Contact Grid */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    font-size: 0.9rem;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.25);
}

.contact-icon {
    font-size: 0.85rem;
}

/* Export Actions */
.export-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.export-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main {
    padding: 2rem;
}

/* Section Styling */
.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1rem;
}

/* Summary Section */
.summary-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.highlight-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e0e7ff;
}

/* Skills Section - Categorized Grid */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.skill-category {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-light);
}

.skill-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-item {
    background: var(--bg-white);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border-medium);
}

/* Experience Section */
.job {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

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

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.job-title-wrapper {
    flex: 1;
    min-width: 200px;
}

.job-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.job-company {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.job-period {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    white-space: nowrap;
}

.job-details {
    list-style: none;
    padding-left: 0;
}

.job-details li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.job-details li::before {
    content: "•";
    position: absolute;
    left: 0.25rem;
    color: var(--primary);
    font-weight: bold;
}

.job-details li:last-child {
    margin-bottom: 0;
}

/* Education Section */
.education-grid {
    display: grid;
    gap: 1rem;
}

.education-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--primary);
}

.degree {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.institution {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.education-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.cgpa-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.grad-date {
    color: var(--text-muted);
    font-weight: 500;
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 1.25rem;
}

.project-item {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 3px solid var(--secondary);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.project-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

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

.project-tag {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Impact Metrics Banner */
.impact-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.metric-value .counter {
    display: inline;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Project Cards */
.project-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.project-expand-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.project-item:hover .project-expand-hint {
    color: var(--primary);
}

.project-expand-hint .chevron {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.65rem;
}

.project-item.expanded .project-expand-hint .chevron {
    transform: rotate(90deg);
}

.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
}

.project-item.expanded .project-details {
    max-height: 300px;
    opacity: 1;
    margin-top: 0.75rem;
}

.project-detail-list {
    list-style: none;
    padding: 0;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

.project-detail-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.project-detail-list li::before {
    content: "▸";
    position: absolute;
    left: 0.15rem;
    color: var(--secondary);
    font-weight: bold;
}

/* Career Timeline */
.experience-timeline {
    position: relative;
    padding-left: 2rem;
}

.experience-timeline::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 1px;
}

.experience-timeline .job {
    position: relative;
}

.experience-timeline .job::before {
    content: "";
    position: absolute;
    left: calc(-1.55rem - 5px);
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2.5px solid var(--primary);
    z-index: 1;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.experience-timeline .job:first-child::before {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.experience-timeline .job:hover::before {
    background: var(--primary);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Skill Proficiency Bars */
.skill-category {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.skill-proficiency {
    margin-top: 0.5rem;
}

.skill-bar-track {
    background: var(--border-light);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0;
    transition: width 1.2s ease-out;
}

.skill-bar-fill.animated {
    /* width set via inline style */
}

/* Experience Highlights (key achievements badges) */
.job-highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid #e0e7ff;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
}

.job-highlights {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
        background: white;
    }

    .resume {
        box-shadow: none;
        border-radius: 0;
    }

    .header {
        padding: 1.25rem 1rem;
        border-radius: 0;
    }

    .name {
        font-size: 1.5rem;
        margin-bottom: 0.35rem;
    }

    .title {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .contact-grid {
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .contact-item {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        background: rgba(255, 255, 255, 0.2);
    }

    .contact-icon {
        font-size: 0.75rem;
    }

    .export-actions {
        position: static;
        justify-content: center;
        margin-bottom: 1rem;
        gap: 0.4rem;
    }

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

    .main {
        padding: 1.25rem 1rem;
    }

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

    .skills-container {
        grid-template-columns: 1fr;
    }

    .job-header {
        flex-direction: column;
    }

    .job-period {
        order: -1;
        margin-bottom: 0.25rem;
    }

    .impact-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .metric-value {
        font-size: 1.35rem;
    }

    .experience-timeline {
        padding-left: 1.5rem;
    }

    .experience-timeline .job::before {
        left: -1.05rem;
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 1.35rem;
    }

    .title {
        font-size: 0.9rem;
    }

    .contact-grid {
        gap: 0.35rem;
    }

    .contact-item {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    .contact-icon {
        font-size: 0.7rem;
    }

    .highlight-tags {
        justify-content: center;
    }
}

/* Print Styles - Optimized for minimal spacing and perfect alignment */
@media print {
    @page {
        margin: 0.4in 0.5in;
        size: letter;
    }

    html {
        font-size: 10pt;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .resume {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Header - Compact and aligned */
    .header {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 0.6rem 0.75rem 0.5rem;
        margin: 0;
    }

    .name {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    .title {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }

    .contact-grid {
        gap: 0.2rem 0.4rem;
        margin-top: 0.3rem;
    }

    .contact-item {
        background: rgba(255, 255, 255, 0.2) !important;
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
        line-height: 1.2;
    }

    .export-actions {
        display: none !important;
    }

    /* Main content - Reduced spacing */
    .main {
        padding: 0.5rem 0.75rem;
    }

    /* Sections - Minimal spacing */
    .section {
        margin-bottom: 0.6rem;
        page-break-inside: avoid;
    }

    .section-title {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        padding-bottom: 0.15rem;
        page-break-after: avoid;
        line-height: 1.2;
    }

    /* Professional Summary */
    .summary-text {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 0.3rem;
    }

    .highlight-tags {
        margin-top: 0.3rem;
        gap: 0.25rem;
    }

    .tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
        line-height: 1.2;
    }

    /* Skills Section - Compact grid */
    .skills-container {
        gap: 0.4rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-category {
        padding: 0.4rem 0.5rem;
        page-break-inside: avoid;
    }

    .skill-category-title {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .skill-item {
        font-size: 0.6rem;
        padding: 0.12rem 0.3rem;
        margin: 0.12rem 0.15rem 0.12rem 0;
        line-height: 1.2;
    }

    /* Projects Section - Compact */
    .project-card {
        padding: 0.4rem 0.5rem;
        margin-bottom: 0.4rem;
        page-break-inside: avoid;
    }

    .project-header h3 {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    .project-link {
        font-size: 0.6rem;
    }

    .project-card p {
        font-size: 0.7rem;
        line-height: 1.35;
        margin-bottom: 0.25rem;
    }

    .project-tags {
        margin-top: 0.25rem;
        gap: 0.2rem;
    }

    .project-tags .tag {
        font-size: 0.55rem;
        padding: 0.1rem 0.3rem;
    }

    /* Experience Section - Tight spacing */
    .job {
        margin-bottom: 0.5rem;
        padding-bottom: 0.4rem;
        page-break-inside: avoid;
    }

    /* Print: hide interactive elements and animations */
    .fade-in-section {
        opacity: 1 !important;
        transform: none !important;
    }

    .impact-metrics {
        display: none !important;
    }

    .project-expand-hint {
        display: none !important;
    }

    .project-details {
        display: none !important;
    }

    .skill-proficiency {
        display: none !important;
    }

    .job-highlights {
        display: none !important;
    }

    .experience-timeline {
        padding-left: 0 !important;
    }

    .experience-timeline::before {
        display: none !important;
    }

    .experience-timeline .job::before {
        display: none !important;
    }
}
