/* --- Variables & Modern Design System --- */
:root {
    --bg-base: #f4f1ea; /* Slate 100 */
    --bg-surface: #ffffff;
    --primary: #1b1b1b; /* Slate 800 */
    --primary-hover: #0b0b0b;
    --accent: #9a7b35; /* Blue 600 */
    --accent-hover: #755a22;
    --accent-light: #f5efe0; /* Blue 50 */
    --brand-dark: #111111;
    --brand-metal: #525252;
    --brand-gold: #b9923d;
    --brand-gold-soft: #f8f1df;
    --success: #16805d; /* Emerald 500 */
    --success-light: #e4f6ef;
    --warning: #b7791f; /* Amber 500 */
    --warning-light: #fef3c7;
    --text-main: #333333; /* Slate 700 */
    --text-muted: #6b665c; /* Slate 500 */
    --border-color: #e4dccd; /* Slate 200 */
    --border-light: #f7f2e8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-focus: 0 0 0 3px rgba(185, 146, 61, 0.28);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Utilities */
h1, h2, h3, h4, h5 { color: var(--primary); font-weight: 700; }
.text-primary { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.m-0 { margin: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 1.5rem !important; }
.mx-auto { margin-right: auto; margin-left: auto; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
}

.brand {
    padding: 22px 18px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    background:
        radial-gradient(circle at 50% 0%, rgba(185, 146, 61, 0.16), transparent 58%),
        linear-gradient(180deg, #fbf7ed, var(--bg-surface));
}

.brand-card {
    width: 100%;
    padding: 18px 16px 16px;
    border: 1px solid rgba(185, 146, 61, 0.22);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8f1df);
    box-shadow: 0 18px 38px rgba(17, 17, 17, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 205px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 18px rgba(17, 17, 17, 0.22));
}

.brand-identity {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-title {
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-gold));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-section {
    padding: 24px 16px;
}

.nav-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
    padding-right: 8px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
    width: 24px;
    text-align: center;
}

.nav-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent);
    border-radius: 4px 0 0 4px;
    transform: scaleY(0);
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    background-color: var(--accent-light);
    color: var(--accent);
    transform: translateX(-4px);
}

.nav-item:hover i, .nav-item.active i {
    color: var(--accent);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name { font-weight: 700; font-size: 14px; color: var(--primary); }
.user-role { font-size: 12px; color: var(--text-muted); }

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    min-width: 0;
}

/* Topbar */
.topbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    width: 100%;
    min-height: 82px;
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 28px;
    border-radius: 24px;
    color: var(--brand-dark);
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.88), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f8f1df 35%, #c9b279 70%, #2b2925 100%);
    box-shadow: 0 18px 36px rgba(17, 17, 17, 0.16);
    border: 1px solid rgba(185, 146, 61, 0.32);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.topbar-title h1::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.topbar-title {
    width: 100%;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 4px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; padding: 0; }
.rounded-circle { border-radius: var(--radius-full); }

.btn-primary { background: linear-gradient(135deg, var(--brand-dark), var(--brand-gold)); color: white; box-shadow: 0 10px 22px rgba(17, 17, 17, 0.12); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--accent-hover)); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary:disabled { background: #b8aa8c; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-success { background-color: var(--success); color: white; }
.btn-success:hover { background-color: #126a4f; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-success:disabled { background-color: #9fcdbd; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline { background-color: rgba(255, 255, 255, 0.72); border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background-color: var(--brand-gold-soft); border-color: var(--brand-gold); color: var(--primary); }

.btn-ghost { background-color: transparent; color: var(--text-muted); border-radius: var(--radius-full); }
.btn-ghost:hover { background-color: var(--border-color); color: var(--primary); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Animation Utils */
.group:hover .group-hover-animate { transform: scale(1.1) rotate(5deg); }
.group-hover-animate { transition: var(--transition); }

/* Content Area */
.content-wrapper {
    padding: 32px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.app-section { display: none; }
.app-section.active-section { display: block; width: 100%; max-width: 100%; overflow-x: hidden; }

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ffffff, var(--brand-gold-soft));
}
.flex-between { display: flex; justify-content: space-between; align-items: center; }

.card-header h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 24px; flex-grow: 1; }

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}
.badge-primary { background-color: var(--accent-light); color: var(--accent); }
.badge-success { background-color: var(--success-light); color: var(--success); }

/* Form Elements */
.form-group { margin-bottom: 24px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--primary); font-size: 15px; }

.textarea-wrapper { position: relative; }
textarea, .form-control {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

textarea {
    padding: 16px;
    min-height: 180px;
    resize: vertical;
}

.form-control { padding: 12px 16px; }

textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.read-only textarea {
    background-color: var(--bg-base);
    color: var(--text-main);
}
.read-only textarea:focus { border-color: var(--border-color); box-shadow: none; }

.border-success-subtle { border-right: 4px solid var(--success); }
.border-warning-subtle { border-right: 4px solid var(--warning); border-color: var(--border-color); }

.copy-btn { position: absolute; top: 12px; left: 12px; background: white; z-index: 5; }

.survey-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-primary);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.survey-section-header i { font-size: 14px; }

.field-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 4px;
}

.survey-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.survey-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.survey-language-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    margin-right: auto;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
}

.survey-lang-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.survey-lang-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-gold));
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.18);
}

.user-survey textarea {
    min-height: 90px;
}

.resume-template-preview {
    display: none;
    direction: ltr;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    min-height: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #111827;
    box-shadow: var(--shadow-sm);
}

.resume-template-preview.active { display: block; }
.textarea-wrapper:has(.resume-template-preview.active) textarea#improved-cv-output {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.resume-template-preview:has(.resume-arabic),
.resume-arabic {
    direction: rtl;
    text-align: right;
}

.resume-template-preview .resume-name { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: 0.5px; margin-bottom: 3px; overflow-wrap: anywhere; }
.resume-template-preview .resume-role { font-size: 14px; font-weight: 700; text-align: center; color: #374151; margin-bottom: 5px; overflow-wrap: anywhere; }
.resume-template-preview .resume-contact { font-size: 11px; text-align: center; color: #4b5563; padding-bottom: 9px; border-bottom: 2px solid #111827; margin-bottom: 12px; overflow-wrap: anywhere; }
.resume-template-preview .resume-section { margin-top: 12px; break-inside: avoid; page-break-inside: avoid; }
.resume-template-preview .resume-section h4 { display: block; font-size: 13px; font-weight: 800; color: #111827; border-bottom: 1px solid #d1d5db; padding-bottom: 4px; margin: 0 0 7px; letter-spacing: 0.4px; line-height: 1.2; }
.resume-template-preview .resume-section p { font-size: 12.5px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.resume-template-preview .resume-section ul { margin: 0; padding-left: 18px; }
.resume-template-preview .resume-section li { font-size: 12.5px; line-height: 1.45; margin-bottom: 3px; overflow-wrap: anywhere; }
.resume-template-preview .resume-job-line { font-size: 12px; font-weight: 700; margin-bottom: 4px; }

/* Chat Section */
.chat-layout {
    display: flex;
    flex-direction: row;
    min-height: 600px;
    margin-bottom: 20px;
    overflow: hidden;
}
.chat-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    min-width: 0;
    overflow: hidden;
}
.evaluation-panel {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.interviewer-profile { display: flex; align-items: center; gap: 16px; }
.avatar-lg {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.bg-primary-light { background-color: var(--accent-light); }
.status-indicator { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.online { background-color: var(--success); box-shadow: 0 0 0 3px var(--success-light); }

.chat-window {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
}

.empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; color: var(--border-color); margin-bottom: 16px; }

/* Chat Messages */
.msg-row { display: flex; width: 100%; margin-bottom: 10px; }
.msg-ai { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }
.msg-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}
.msg-ai .msg-bubble { background-color: white; border: 1px solid var(--border-color); border-bottom-right-radius: 4px; }
.msg-user .msg-bubble { background-color: var(--accent); color: white; border-bottom-left-radius: 4px; }

/* Typing animation */
.typing-indicator { display: flex; gap: 4px; padding: 5px 10px; }
.typing-dot { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; opacity: 0.6; animation: typing 1.4s infinite ease-in-out; }
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.chat-input-wrapper { padding: 20px 24px; border-top: 1px solid var(--border-color); background: white; }
.chat-input-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    transition: var(--transition);
}
.chat-input-inner:focus-within { border-color: var(--accent); background-color: white; box-shadow: var(--shadow-sm); }
.chat-input-inner textarea {
    flex-grow: 1;
    border: none; background: transparent; padding: 8px 0; min-height: 40px; max-height: 120px; box-shadow: none; resize: none; overflow-y: auto;
}
.chat-hints { padding-top: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* Evaluation Panel */
.bg-light { background-color: var(--border-light); }
.evaluation-panel { padding: 24px; display: flex; flex-direction: column; }
.panel-heading h3 { font-size: 18px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }

.eval-results-hidden { display: none; opacity: 0; transition: opacity 0.5s; }
.eval-results-hidden.show { display: block; opacity: 1; }

.score-card { display: flex; align-items: center; gap: 20px; background: white; padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.score-circle { width: 70px; height: 70px; }
.circular-chart { display: block; margin: 0 auto; max-width: 80%; max-height: 250px; }
.circle-bg { fill: none; stroke: #eee; stroke-width: 3.8; }
.circle { fill: none; stroke-width: 2.8; stroke-linecap: round; animation: progress 1s ease-out forwards; }
@keyframes progress { 0% { stroke-dasharray: 0 100; } }
.circular-chart.green .circle { stroke: var(--success); }
.percentage { fill: var(--primary); font-family: inherit; font-size: 10px; font-weight: bold; text-anchor: middle; }

.feedback-item { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius-md); border-right: 4px solid; background: white; box-shadow: var(--shadow-sm); }
.feedback-item.success { border-color: var(--success); }
.feedback-item.warning { border-color: var(--warning); }
.fi-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.feedback-item.success .fi-icon { background: var(--success-light); color: var(--success); }
.feedback-item.warning .fi-icon { background: var(--warning-light); color: var(--warning); }
.fi-content h5 { font-size: 15px; margin-bottom: 4px; }
.fi-content p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* Company Intelligence */
.intelligence-header { margin-bottom: 40px; }
.icon-hero { font-size: 48px; color: var(--accent); margin-bottom: 16px; }
.golden-icon-hero { color: var(--brand-gold); }

.form-row { display: flex; gap: 16px; }
.flex-1 { flex: 1; }
.input-icon-wrapper { position: relative; }
.input-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon-wrapper .form-control { padding-right: 44px; }

.border-t-primary { border-top: 4px solid var(--accent); }
.report-title { display: flex; align-items: center; gap: 12px; }
.rt-icon { width: 40px; height: 40px; background: var(--accent-light); color: var(--accent); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* Career Library */
.library-layout { max-width: 1100px; margin: 0 auto; }
.library-filters { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
#influencers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; width: 100%; }
#influencers-grid .library-grid { display: contents; }
#influencers-grid .library-card { min-height: unset; }
.library-card { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(180deg, #ffffff, #fffaf0); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); transition: var(--transition); }
.library-card:hover { transform: translateY(-4px); border-color: rgba(185, 146, 61, 0.45); box-shadow: 0 14px 28px rgba(17, 17, 17, 0.10); }
.library-card-icon { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; }
.library-pdf-preview { height: 150px; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; background: var(--border-light); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 14px; }
.library-pdf-preview canvas { max-width: 100%; height: auto; box-shadow: var(--shadow-sm); background: white; }
.library-card-body { flex: 1; }
.library-category { display: inline-block; font-size: 12px; color: var(--accent); background: var(--accent-light); padding: 4px 8px; border-radius: 999px; margin-bottom: 10px; }
.library-card h3 { font-size: 17px; margin-bottom: 8px; color: var(--text-main); }
.library-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.library-download { margin-top: 18px; justify-content: center; }
.library-section-title {
    grid-column: 1 / -1;
    margin-top: 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(185, 146, 61, 0.14), rgba(17, 17, 17, 0.04));
    border: 1px solid var(--border-color);
    text-align: center;
}
.library-section-title h3 { margin-bottom: 6px; color: var(--primary); font-size: 22px; }
.library-section-title p { margin: 0; color: var(--text-muted); font-size: 14px; }
.influencer-card { align-items: stretch; text-align: center; }
.influencer-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    align-self: center;
    margin-bottom: 16px;
    border: 4px solid #ffffff;
    outline: 2px solid rgba(185, 146, 61, 0.42);
    box-shadow: 0 14px 28px rgba(17, 17, 17, 0.14);
}

/* Golden Tips */
.golden-tips-header {
    background: linear-gradient(135deg, rgba(185, 146, 61, 0.18), rgba(17, 17, 17, 0.06));
    border: 1px solid rgba(185, 146, 61, 0.4);
}
.golden-tips-header h3 { color: var(--brand-gold); display: flex; align-items: center; justify-content: center; gap: 10px; }
.golden-tip-card {
    border-top: 3px solid var(--brand-gold);
}
.golden-tip-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-gold));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.library-filter[data-category="GoldenTips"].active,
.library-filter[data-category="GoldenTips"]:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-gold));
    border-color: transparent;
    color: #fff;
}

/* Influencers Section */
.influencers-icon-hero { color: var(--accent); }
.influencers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}
.inf-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.inf-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px; height: 100%;
    background: var(--brand-gold);
    opacity: 0;
    transition: opacity 0.25s;
}
.inf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(17,17,17,0.10);
    border-color: rgba(185,146,61,0.35);
}
.inf-card:hover::before { opacity: 1; }
.inf-avatar {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    border: 1.5px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.inf-body { flex: 1; min-width: 0; }
.inf-header {
    display: flex; align-items: center;
    gap: 8px; margin-bottom: 4px; flex-wrap: wrap;
}
.inf-header h3 { font-size: 16px; font-weight: 700; color: var(--primary); margin: 0; }
.inf-field-tag {
    font-size: 11px; font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    white-space: nowrap;
}
.inf-handle {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    direction: ltr;
    text-align: right;
}
.inf-body p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.inf-handle-small { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; direction: ltr; text-align: right; }
.inf-platform-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    align-self: flex-start;
}

/* Job Platforms */
.job-platforms-icon-hero { color: var(--accent); }
.job-platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}
.job-platform-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #ffffff, #fffdf7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}
.job-platform-card:hover {
    transform: translateY(-4px);
    border-color: rgba(185, 146, 61, 0.45);
    box-shadow: 0 14px 28px rgba(17, 17, 17, 0.10);
}
.jp-logo-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}
.jp-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.jp-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
}
.jp-body {
    flex: 1;
    min-width: 0;
}
.jp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.jp-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.jp-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
}
.jp-body p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 5px;
    line-height: 1.5;
}
.jp-url {
    font-size: 11px;
    color: var(--brand-gold);
    direction: ltr;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.85;
}
.jp-arrow {
    color: var(--brand-gold);
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: var(--transition);
}
.job-platform-card:hover .jp-arrow {
    opacity: 1;
    transform: translateX(-4px);
}

/* Golden Tips — Professional Grid */
#golden-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}
.gt-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-surface);
    box-shadow: 0 2px 10px rgba(17,17,17,0.08);
    border: 1.5px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    aspect-ratio: 1 / 1;
}
.gt-card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 14px 32px rgba(17,17,17,0.14);
    border-color: var(--brand-gold);
}
.gt-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.gt-card:hover img {
    transform: scale(1.04);
}
.gt-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(185,146,61,0.0) 50%, rgba(17,17,17,0.55) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 10px 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.gt-card:hover .gt-overlay { opacity: 1; }
.gt-num {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.35);
    padding: 2px 8px;
    border-radius: 20px;
}
.gt-overlay i {
    color: white;
    font-size: 18px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Lightbox */
#gt-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#gt-lightbox.open { display: flex; }
.gt-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(6px);
}
.gt-lb-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 92vw;
    max-height: 92vh;
}
#gt-lb-img {
    max-width: 80vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    object-fit: contain;
    display: block;
}
.gt-lb-close {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.gt-lb-close:hover { background: rgba(255,255,255,0.28); }
.gt-lb-prev, .gt-lb-next {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.gt-lb-prev:hover, .gt-lb-next:hover { background: rgba(255,255,255,0.25); }
#gt-lb-counter {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 600;
    background: rgba(0,0,0,0.4);
    padding: 4px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Toasts */
.toast-container { position: fixed; bottom: 24px; left: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { background: white; border-radius: var(--radius-md); padding: 16px 20px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: slideUp 0.3s ease forwards; max-width: 350px; border-right: 4px solid var(--accent); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: #ef4444; }
.toast-icon { font-size: 20px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: #ef4444; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================
   RESPONSIVE — Full Mobile / Tablet Support
   ============================================= */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
    display: none;
    flex-shrink: 0;
}

/* Sidebar overlay — hidden on desktop */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ---- Tablet (≤ 1024px) ---- */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .chat-layout { flex-direction: column; min-height: auto; }
    .chat-container { border-left: none; border-bottom: 1px solid var(--border-color); height: 400px; }
    .form-row { flex-direction: column; }
    .brand-logo { width: 170px; }
    .content-wrapper { padding: 24px 28px; }
    .topbar { padding: 16px 24px; }
    .job-platforms-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {

    /* Allow page scroll */
    body { overflow-x: hidden; overflow-y: auto; }

    /* Layout */
    .app-container {
        flex-direction: column;
        height: auto !important;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: visible;
    }

    /* Sidebar becomes a drawer */
    .sidebar {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100%;
        z-index: 100;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .sidebar.open {
        right: 0;
        box-shadow: -8px 0 32px rgba(17, 17, 17, 0.18);
    }
    .sidebar-overlay.open { display: block; }

    /* Show hamburger */
    .hamburger-btn { display: flex; }

    /* Main content takes full width */
    .main-content { width: 100%; flex: 1; overflow-y: auto; overflow-x: hidden; }

    /* Topbar */
    .topbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
    .topbar-title { width: 100%; }
    .topbar-title h1 { font-size: 16px; min-height: unset; padding: 10px 14px; border-radius: 14px; margin-bottom: 4px; }
    .topbar-title p { font-size: 12px; }

    /* Content wrapper */
    .content-wrapper { padding: 14px 12px; }

    /* Brand card */
    .brand { padding: 16px 12px; }
    .brand-logo { width: 130px; }
    .brand-title { font-size: 17px; }

    /* Nav */
    .nav-section { padding: 14px 10px; }
    .nav-item { font-size: 14px; padding: 11px 12px; }

    /* Cards */
    .grid-2 { grid-template-columns: 1fr; gap: 14px; }
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; }

    /* CV section */
    .form-row { flex-direction: column; }
    .survey-grid { grid-template-columns: 1fr; }

    /* ---- Interview Coach Fix ---- */
    .chat-layout {
        display: flex !important;
        flex-direction: column !important;
        min-height: unset !important;
        border-radius: var(--radius-lg);
        overflow: visible !important;
    }
    .chat-container {
        border-left: none !important;
        border-bottom: 1px solid var(--border-color);
        height: auto !important;
        min-height: unset !important;
    }
    .chat-window {
        max-height: 300px !important;
        min-height: 180px;
        padding: 14px;
    }
    .chat-header { padding: 14px 16px; flex-wrap: wrap; gap: 10px; }
    .chat-actions { width: 100%; }
    .chat-actions .btn { width: 100%; justify-content: center; }
    .chat-input-wrapper { padding: 12px 14px; }
    .msg-bubble { font-size: 14px; padding: 10px 14px; max-width: 90%; }

    /* Evaluation panel — full width below chat */
    .evaluation-panel {
        padding: 14px;
        border-top: 1px solid var(--border-color);
        background-color: var(--border-light);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    .panel-heading h3 { font-size: 16px; }
    .score-card { padding: 14px; gap: 14px; }

    /* Library */
    .library-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    #influencers-grid .library-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .library-filters { gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
    .library-filters .btn { font-size: 12px; padding: 7px 10px; }
    .library-card { min-height: unset; padding: 14px; }
    .library-card h3 { font-size: 15px; }
    .library-card p { font-size: 13px; }

    /* Job platforms */
    .job-platforms-grid { grid-template-columns: 1fr; gap: 10px; }
    .job-platform-card { padding: 12px 14px; gap: 12px; }
    .jp-logo-wrap { width: 44px; height: 44px; }
    .jp-header h3 { font-size: 15px; }
    .jp-body p { font-size: 12px; }

    /* ---- Golden Tips Fix ---- */
    #golden-tips-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .gt-card { aspect-ratio: 1 / 1; }
    .gt-overlay { opacity: 1; background: linear-gradient(160deg, transparent 60%, rgba(17,17,17,0.45) 100%); }

    /* Intelligence header */
    .intelligence-header { margin-bottom: 20px; }
    .icon-hero { font-size: 32px; margin-bottom: 10px; }
    .intelligence-header h2 { font-size: 22px; }

    /* Influencer cards */
    .influencer-photo { width: 80px; height: 80px; }
    .library-section-title h3 { font-size: 17px; }
    .library-section-title p { font-size: 13px; }

    /* Buttons */
    .btn-lg { padding: 12px 18px; font-size: 15px; }
    .btn-block { width: 100%; }

    /* Company section */
    .input-icon-wrapper input { font-size: 14px; }
}

/* ---- Small Mobile (≤ 400px) ---- */
@media (max-width: 400px) {
    .topbar-title h1 { font-size: 14px; padding: 8px 10px; }
    .content-wrapper { padding: 10px 8px; }
    .nav-item { font-size: 13px; padding: 10px 10px; }
    #golden-tips-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
    #gt-lb-img { max-width: 95vw; max-height: 80vh; }
    .gt-lb-prev, .gt-lb-next { display: none; }
    .library-grid { grid-template-columns: repeat(2, 1fr); }
    .job-platforms-grid { grid-template-columns: 1fr; }
    .chat-window { max-height: 240px !important; }
    .library-filters .btn { font-size: 11px; padding: 6px 8px; }
}
