/* --- GLOBAL DESIGN SYSTEM & VARIABLES --- */
:root {
    /* Color Palette - Dark Mode Default */
    --bg-main: #0b0f19;
    --bg-card: #111827;
    --bg-card-hover: #1f293d;
    --bg-sidebar: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    
    /* Domain Specific Colors */
    --devops-color: #38bdf8;
    --devops-bg: rgba(56, 189, 248, 0.12);
    --cyber-color: #ef4444;
    --cyber-bg: rgba(239, 68, 68, 0.12);
    --dev-color: #10b981;
    --dev-bg: rgba(16, 185, 129, 0.12);
    --net-color: #f59e0b;
    --net-bg: rgba(245, 158, 11, 0.12);
    --data-color: #a855f7;
    --data-bg: rgba(168, 85, 247, 0.12);

    --primary-accent: #6366f1;
    --primary-accent-hover: #4f46e5;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --devops-bg: rgba(56, 189, 248, 0.18);
    --cyber-bg: rgba(239, 68, 68, 0.18);
    --dev-bg: rgba(16, 185, 129, 0.18);
    --net-bg: rgba(245, 158, 11, 0.18);
    --data-bg: rgba(168, 85, 247, 0.18);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 40px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* RTL Arabic Font & Layout */
body.rtl-layout {
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
    direction: rtl;
    text-align: right;
}

body.rtl-layout .contact-item .icon {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl-layout .section-heading .icon-head {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl-layout .exp-company i,
body.rtl-layout .category-title i {
    margin-right: 0;
    margin-left: 6px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- TOP CONTROLS BAR --- */
.top-controls {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
}

[data-theme="light"] .top-controls {
    background-color: rgba(255, 255, 255, 0.85);
}

.controls-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-gradient {
    color: var(--devops-color);
}

/* Language Box */
.lang-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.lang-icon {
    color: var(--primary-accent);
    font-size: 0.9rem;
}

.lang-dropdown {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.lang-dropdown option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* Filter Buttons */
.domain-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary-accent);
}

.filter-btn.active {
    background-color: var(--primary-accent);
    color: #ffffff;
    border-color: var(--primary-accent);
}

.utility-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-card-hover);
}

.action-btn.primary-btn {
    background-color: var(--devops-color);
    color: #0b0f19;
    border-color: var(--devops-color);
}

.action-btn.primary-btn:hover {
    opacity: 0.9;
}

/* --- MAIN CV CONTAINER --- */
.cv-card {
    max-width: 1100px;
    margin: 24px auto 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    transition: background-color 0.3s ease;
}

/* Header Section */
.cv-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.avatar-box {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--devops-color), var(--primary-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #ffffff;
    flex-shrink: 0;
}

.candidate-name {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.candidate-title {
    font-size: 1.1rem;
    color: var(--devops-color);
    font-weight: 600;
    margin-bottom: 6px;
}

.subtitle-tagline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pillar-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pillar-tag.devops { background: var(--devops-bg); color: var(--devops-color); }
.pillar-tag.cyber { background: var(--cyber-bg); color: var(--cyber-color); }
.pillar-tag.dev { background: var(--dev-bg); color: var(--dev-color); }
.pillar-tag.net { background: var(--net-bg); color: var(--net-color); }
.pillar-tag.data { background: var(--data-bg); color: var(--data-color); }

/* Contact Grid */
.header-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    font-size: 0.85rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.contact-item .icon {
    color: var(--devops-color);
}

.contact-item.highlight-badge {
    color: var(--dev-color);
    font-weight: 600;
}

/* Sections */
.cv-section {
    margin-bottom: 24px;
}

.section-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-heading .icon-head {
    color: var(--devops-color);
}

.profile-description {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Layout Grid */
.cv-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
}

@media (max-width: 900px) {
    .cv-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.skill-category-block {
    margin-bottom: 14px;
    transition: transform 0.2s ease;
}

.category-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.devops-color { color: var(--devops-color); }
.cyber-color { color: var(--cyber-color); }
.dev-color { color: var(--dev-color); }
.net-color { color: var(--net-color); }
.data-color { color: var(--data-color); }

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.skill-tag {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

/* Timeline */
.timeline-compact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-card {
    background: var(--bg-sidebar);
    border-left: 3px solid var(--devops-color);
    padding: 8px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

body.rtl-layout .timeline-card {
    border-left: none;
    border-right: 3px solid var(--devops-color);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-degree {
    font-size: 0.88rem;
    font-weight: 700;
}

.timeline-school {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.soft-list {
    list-style: none;
    font-size: 0.84rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Experience Cards */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.experience-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.exp-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
}

.exp-company {
    font-size: 0.85rem;
    color: var(--devops-color);
    font-weight: 600;
}

.exp-badge {
    background: var(--devops-bg);
    color: var(--devops-color);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.exp-summary {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-style: italic;
}

.task-group {
    margin-bottom: 8px;
}

.task-group h6 {
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.task-group ul {
    list-style-position: inside;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.simple-exp-list {
    font-size: 0.84rem;
    color: var(--text-secondary);
    list-style-position: inside;
}

.cv-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
    padding-top: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- PRINT MEDIA QUERIES (A4 PRINT ENGINE) --- */
@media print {
    .print-hide, .top-controls {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
    }

    .cv-card {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
    }

    .skill-tag, .timeline-card, .experience-card {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        color: #000000 !important;
    }

    .pillar-tag {
        border: 1px solid #cbd5e1 !important;
    }
}
