/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-color: #0b0f19;
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    
    /* Core Accents */
    --accent-web: #06b6d4;      /* Cyan */
    --accent-security: #10b981; /* Emerald */
    --accent-game: #a855f7;     /* Purple */
    
    /* Hover Glows */
    --shadow-web: 0 0 20px rgba(6, 182, 212, 0.15);
    --shadow-security: 0 0 20px rgba(16, 185, 129, 0.15);
    --shadow-game: 0 0 20px rgba(168, 85, 247, 0.15);

    /* Common Layout & Styling */
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Light Theme Variables */
body.light-theme {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    
    /* Soft shadows for light mode */
    --shadow-web: 0 4px 20px rgba(6, 182, 212, 0.12);
    --shadow-security: 0 4px 20px rgba(16, 185, 129, 0.12);
    --shadow-game: 0 4px 20px rgba(168, 85, 247, 0.12);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
    padding: 2rem 1rem;
}

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

/* ==========================================================================
   CONTROL PANEL (THEME & PRINT)
   ========================================================================== */
.control-panel {
    max-width: 1000px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.control-btn:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.control-btn svg {
    width: 16px;
    height: 16px;
}

/* Theme Icon Visibility toggle */
body.dark-theme .sun-icon,
body.light-theme .moon-icon {
    display: inline-block;
}

body.dark-theme .moon-icon,
body.light-theme .sun-icon {
    display: none;
}

/* ==========================================================================
   CV CONTAINER LAYOUT
   ========================================================================== */
.cv-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.cv-header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-main {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.profile-img-container {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    z-index: 2;
    position: relative;
}

.profile-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-web), var(--accent-security), var(--accent-game));
    z-index: 1;
    opacity: 0.65;
    filter: blur(8px);
    animation: rotateGlow 10s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.profile-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.name-pronouns {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pronouns {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.tagline {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.quick-tags {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.q-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.q-web { background-color: rgba(6, 182, 212, 0.12); color: var(--accent-web); }
.q-sec { background-color: rgba(16, 185, 129, 0.12); color: var(--accent-security); }
.q-game { background-color: rgba(168, 85, 247, 0.12); color: var(--accent-game); }

/* Header Contact Info */
.header-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-item .icon {
    width: 16px;
    height: 16px;
    color: var(--text-primary);
    opacity: 0.7;
}

.contact-item a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ==========================================================================
   FILTER NAVIGATION
   ========================================================================== */
.filter-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.filter-btn[data-filter="web"].active {
    color: var(--accent-web);
    border-color: var(--accent-web);
    background-color: rgba(6, 182, 212, 0.08);
}

.filter-btn[data-filter="security"].active {
    color: var(--accent-security);
    border-color: var(--accent-security);
    background-color: rgba(16, 185, 129, 0.08);
}

.filter-btn[data-filter="game"].active {
    color: var(--accent-game);
    border-color: var(--accent-game);
    background-color: rgba(168, 85, 247, 0.08);
}

/* ==========================================================================
   CV TWO-COLUMN LAYOUT
   ========================================================================== */
.cv-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3.5rem;
    margin-top: 2.5rem;
}

/* Sidebar Sections */
.cv-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--accent-web), var(--accent-game));
}

.about-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: justify;
}

/* Git Badge styling */
.git-badge-container {
    margin: 0.5rem 0;
}

.git-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(240, 80, 50, 0.08);
    border: 1px solid rgba(240, 80, 50, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f05032; /* Official Git color code */
    animation: gitPulse 4s infinite alternate;
}

.git-badge svg {
    width: 18px;
    height: 18px;
}

.git-badge .heart {
    color: #ef4444;
    animation: heartbeat 1.5s infinite;
    display: inline-block;
    margin-left: 2px;
}

@keyframes gitPulse {
    0% { box-shadow: 0 0 5px rgba(240, 80, 50, 0); }
    100% { box-shadow: 0 0 15px rgba(240, 80, 50, 0.15); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* Skill Tags categories */
.skill-category {
    margin-bottom: 0.6rem;
    transition: var(--transition-smooth);
}

.skill-cat-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.web-color { color: var(--accent-web); }
.security-color { color: var(--accent-security); }
.game-color { color: var(--accent-game); }

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

.skill-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.skill-category[data-cat="web"] .skill-tag:hover {
    border-color: var(--accent-web);
    box-shadow: var(--shadow-web);
    color: var(--accent-web);
    transform: translateY(-1px);
}

.skill-category[data-cat="security"] .skill-tag:hover {
    border-color: var(--accent-security);
    box-shadow: var(--shadow-security);
    color: var(--accent-security);
    transform: translateY(-1px);
}

.skill-category[data-cat="game"] .skill-tag:hover {
    border-color: var(--accent-game);
    box-shadow: var(--shadow-game);
    color: var(--accent-game);
    transform: translateY(-1px);
}

/* Soft Skills List */
.soft-skills-list {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.soft-skills-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.2rem;
}

.soft-skills-list li::before {
    content: "•";
    color: var(--text-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* ==========================================================================
   MAIN SECTION (RIGHT COLUMN)
   ========================================================================== */
.cv-main {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.main-section {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    transition: var(--transition-smooth);
}

/* Timeline Components */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
    margin-bottom: 1rem;
    transition: var(--transition-smooth);
}

.timeline-item:last-child {
    margin-bottom: 0;
    border-left: 2px solid transparent; /* Hide bottom border hook */
}

/* Hide line overlay on top timeline item if last-child hidden, use marker lines */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.timeline-item:last-child::after {
    height: 1.5rem; /* Cap line at the marker level */
}

.timeline-marker {
    position: absolute;
    left: -7px;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 3;
    transition: var(--transition-smooth);
}

.web-bg { background-color: var(--accent-web); }
.security-bg { background-color: var(--accent-security); }
.game-bg { background-color: var(--accent-game); }

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

.role-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.organization {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.1rem;
}

.date-badge {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.item-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-align: justify;
}

.font-italic {
    font-style: italic;
    color: var(--text-primary);
    opacity: 0.85;
}

.bullet-details {
    list-style-type: none;
    margin-bottom: 0.8rem;
}

.bullet-details li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    padding-left: 1rem;
    position: relative;
}

.bullet-details li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1rem;
    line-height: 0.85rem;
}

.item-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.i-skill {
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* timeline-item Hover */
.timeline-item:hover .timeline-marker {
    transform: scale(1.4);
    box-shadow: 0 0 10px currentColor;
}

/* Project Card components */
.project-card {
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.project-card:hover {
    border-color: var(--accent-game);
    box-shadow: var(--shadow-game);
    transform: translateY(-3px);
}

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

.project-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.project-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.game-tag {
    background-color: rgba(168, 85, 247, 0.15);
    color: var(--accent-game);
}

.project-association {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: justify;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-game);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    background-color: rgba(168, 85, 247, 0.03);
}

.project-link:hover {
    background-color: var(--accent-game);
    color: #fff;
    box-shadow: var(--shadow-game);
}

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

/* ==========================================================================
   INTERACTIVE JAVASCRIPT FILTERING ACTIONS
   ========================================================================== */
.fade-out {
    opacity: 0.1;
    pointer-events: none;
    transform: scale(0.98);
}

.highlight-section {
    border-color: currentColor;
    transform: translateY(-2px);
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.cv-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 868px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .cv-container {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .header-main {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cv-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .profile-text h1 {
        font-size: 2rem;
    }
    
    .name-pronouns {
        justify-content: center;
    }
    
    .quick-tags {
        justify-content: center;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    
    .date-badge {
        align-self: flex-start;
    }
}

/* ==========================================================================
   PRINT STYLESHEET (A4 PDF GENERATION)
   ========================================================================== */
@media print {
    /* Reset screen styles */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
        padding: 0 !important;
    }
    
    /* Remove background gradients */
    body, .cv-container, .project-card, .header-contact, .git-badge, .control-panel, .filter-nav {
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        border-color: #ccc !important;
    }
    
    /* Remove padding and border from container */
    .cv-container {
        border: none !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    /* Hide non-print components */
    .no-print {
        display: none !important;
    }
    
    /* Contact link handling */
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
    
    /* Flex and grid adjustment for print */
    .cv-layout {
        grid-template-columns: 1fr 2fr !important;
        gap: 2.5rem !important;
        margin-top: 1.5rem !important;
    }
    
    .cv-header {
        border-bottom: 2px solid #333 !important;
        padding-bottom: 1rem !important;
        gap: 1rem !important;
    }
    
    .profile-img-container {
        width: 90px !important;
        height: 90px !important;
    }
    
    .profile-glow {
        display: none !important;
    }
    
    .profile-img {
        border: 2px solid #000 !important;
    }
    
    .profile-text h1 {
        font-size: 1.8rem !important;
        color: #000 !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
    }
    
    .tagline {
        font-size: 1rem !important;
        color: #333 !important;
    }
    
    .quick-tags {
        display: none !important;
    }
    
    .header-contact {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        font-size: 8pt !important;
    }
    
    /* Page control rules */
    .timeline-item, .project-card, .sidebar-section {
        page-break-inside: avoid !important;
    }
    
    .section-title {
        font-size: 1.1rem !important;
        border-bottom: 1.5px solid #000 !important;
        color: #000 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .section-title::after {
        display: none !important;
    }
    
    .about-text, .item-desc, .bullet-details li, .soft-skills-list li {
        color: #111 !important;
        font-size: 8.5pt !important;
    }
    
    /* Badges styles on paper */
    .git-badge {
        border: 1px solid #ccc !important;
        color: #000 !important;
        padding: 0.4rem !important;
        font-size: 8pt !important;
    }
    
    .skill-tag {
        border: 1px dashed #777 !important;
        background: transparent !important;
        color: #000 !important;
        font-size: 7.5pt !important;
        padding: 0.2rem 0.5rem !important;
    }
    
    .i-skill {
        background: transparent !important;
        border: 1px solid #999 !important;
        color: #111 !important;
        font-size: 7pt !important;
    }
    
    .timeline-marker {
        border: 1px solid #000 !important;
        background: #000 !important;
    }
}
