/* Global Styles */
:root {
    --primary-color: #4f46e5;
    /* Electric Indigo */
    --accent-color: #06b6d4;
    /* Vibrant Cyan */
    --accent-secondary: #6366f1;
    /* Indigo */
    --bg-color: #0f172a;
    /* Slate 900 */
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #475569;
    --sidebar-bg: #1e1b4b;
    /* Indigo 950 */
    --sidebar-text: #f8fafc;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Roboto Mono', monospace;
    --sidebar-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
}

#particles-js,
#neural-canvas {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

@media print {
    #particles-js {
        display: none !important;
    }
}

/* Floating Download Button */
.floating-download-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    white-space: nowrap;
}

.floating-download-btn .btn-text {
    max-width: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.floating-download-btn:hover {
    box-shadow: 0 6px 30px rgba(6, 182, 212, 0.6);
    transform: translateY(-2px);
}

.floating-download-btn:hover .btn-text {
    max-width: 150px;
    opacity: 1;
    margin-left: 5px;
}

.floating-download-btn i {
    font-size: 1.1rem;
}

@media print {
    .floating-download-btn {
        display: none !important;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-heading);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(220, 50%, 10%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(230, 40%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(200, 50%, 12%, 1) 0, transparent 50%);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
    padding: 40px 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Layout */
.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--card-bg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-gradient);
    color: var(--sidebar-text);
    flex: 0 0 320px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 35px;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.profile-header {
    text-align: center;
    position: relative;
    z-index: 1;
}

.profile-img-container {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
    transition: transform 0.5s ease;
}

.profile-img-container:hover {
    transform: scale(1.05);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -1px;
    color: #ffffff;
}

.role {
    font-size: 0.95rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.transition-arrow {
    margin: 8px 0;
    color: var(--accent-secondary);
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px var(--accent-secondary));
    animation: bounce 2s infinite;
}

.role.pivot {
    color: #fff;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
    backdrop-filter: blur(4px);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-item i {
    width: 20px;
    color: var(--accent-color);
    text-align: center;
}

.contact-item a:hover {
    color: var(--accent-color);
}

.skills-section h3 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
}

.skill-category {
    margin-bottom: 25px;
}

.skill-category h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #fff;
    font-family: var(--font-body);
    border-left: 2px solid var(--accent-color);
    padding-left: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-body);
}

.tags.secondary span {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.list-skills li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    position: relative;
    padding-left: 15px;
}

.list-skills li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* Main Content */
.main-content {
    flex: 2 1 500px;
    padding: 50px;
    background-color: white;
}

.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

.section-title i {
    color: var(--accent-color);
}

.summary-section p {
    font-size: 1rem;
    color: var(--text-muted);
}

.timeline-item {
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 2px solid #eee;
    margin-left: 5px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.timeline-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.date,
.company {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

.company::after {
    content: " | ";
    color: #ccc;
    margin: 0 5px;
}

.role-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #f1f1f1;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.achievements {
    margin-top: 10px;
}

.achievements li {
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 20px;
}

.achievements li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.education-item {
    margin-bottom: 20px;
}

.education-item h3 {
    font-size: 1.05rem;
}

.education-item .school {
    color: var(--text-muted);
}

/* Soft Skills Styling */
.soft-skill-item {
    margin-bottom: 12px;
}

.soft-skill-item strong {
    display: block;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.soft-skill-item p {
    color: #bdc3c7;
    /* Muted sidebar text */
    font-size: 0.85rem;
    margin-top: 2px;
    line-height: 1.3;
}

/* Narrative Section */
.narrative-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-secondary);
}

.narrative-content p {
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.narrative-content strong {
    color: var(--primary-color);
}

.hobby-note {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0 !important;
    font-size: 0.85rem !important;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    margin-top: 10px;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .container {
        flex-direction: column;
        margin: 0;
    }

    .sidebar {
        padding: 30px;
    }

    .main-content {
        padding: 30px;
    }
}

/* Print Styles - Robust A4 Grid Layout */
@media print {
    @page {
        size: A4;
        margin: 0mm;
        /* No browser margins */
    }

    .narrative-section {
        page-break-inside: avoid;
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .narrative-content p {
        page-break-inside: avoid;
        font-size: 0.87rem !important;
        font-weight: 500;
        padding: 0px !important;
    }

    body {
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 11px;
        /* Compact font for single/double page */
        background-color: white;
    }

    .container {
        width: 100%;
        max-width: none;
        box-shadow: none;
        margin: 0;
        min-height: 297mm;
        border-radius: 0 !important;
        /* Sharp corners for PDF */

        /* CSS Grid is more robust than Flex for print columns */
        display: grid !important;
        grid-template-columns: 28% 72% !important;
        align-items: start;
    }

    .sidebar {
        background-color: #1a252f !important;
        color: #ecf0f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;

        /* Ensure sidebar prints full height */
        min-height: 100vh;
        height: 100%;
        padding: 15px !important;

        /* Fix sidebar content size */
        font-size: 10px;
    }

    .main-content {
        padding: 20px 25px !important;
        background-color: white;
    }

    /* Compacting Content to fit 2 pages max */
    .section {
        margin-bottom: 20px !important;
    }

    .section-title {
        margin-bottom: 10px !important;
        font-size: 1.2rem !important;
        padding-bottom: 5px !important;
    }

    .name {
        font-size: 1.6rem !important;
        margin-bottom: 2px !important;
    }

    .role {
        font-size: 0.9rem !important;
    }

    .profile-img-container {
        width: 90px !important;
        height: 90px !important;
        margin-bottom: 10px !important;
        border-width: 2px !important;
    }

    .timeline-item {
        margin-bottom: 12px !important;
        padding-left: 15px !important;
    }

    .timeline-header h3 {
        font-size: 1rem !important;
    }

    /* Sidebar Compaction */
    .sidebar {
        gap: 20px !important;
    }

    .contact-item {
        gap: 8px !important;
        margin-bottom: 5px !important;
    }

    .contact-info {
        gap: 6px !important;
        padding: 12px !important;
        font-size: 0.75rem !important;
    }

    .contact-item i {
        width: 16px !important;
    }

    /* Avoid Breaks */
    /* Avoid Breaks */
    h1,
    h2,
    h3,
    h4,
    h5 {
        break-after: avoid;
        page-break-after: avoid;
    }

    .timeline-item,
    .education-item,
    .skill-category,
    .narrative-section,
    .soft-skill-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .page-break {
        break-before: page;
        page-break-before: always;
        margin-top: 30px;
        display: block;
    }

    /* Hide visuals that waste ink/space */
    a[href]:after {
        content: none !important;
    }

    .transition-arrow {
        display: none !important;
    }

    /* Tweaks */
    .tags span {
        border: 1px solid #7f8c8d;
        color: #000 !important;
    }

    .skill-category h4 {
        color: #3498db !important;
    }
}