/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --doc-font: 'Lato', sans-serif;
    --gold-accent: #d4af37; /* Bright Gold */
    --bg-light: #f8fafc;
    --sidebar-width: 260px; 
    --header-height: 60px;
    --sidebar-bg: #0b1120;
    --navy-light: #1e293b;
    --text-dark: #334155;
    --navy-dark: #0b1120;
}

body { 
    background-color: var(--bg-light); 
    font-family: var(--doc-font); 
    padding-bottom: 40px; 
    padding-top: var(--header-height); 
    padding-left: var(--sidebar-width); 
    transition: padding-left 0.05s linear; 
    overflow-y: auto; 
}

.main-stage { min-height: calc(100vh - 100px); display: flex; flex-direction: column; }

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
.section-title {
    font-family: var(--doc-font); 
    font-weight: 700;
    color: #0b1120;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    break-after: avoid;
}

.font-serif-bold { font-family: var(--doc-font); font-weight: 700; }
.font-sans-regular { font-family: var(--doc-font); font-weight: 400; }

.sidebar-name { 
    font-family: var(--doc-font); 
    font-size: 2.5rem; 
    font-weight: 700; 
    line-height: 1.1; 
    color: white; 
    word-wrap: break-word; 
}

.sidebar-role { 
    font-family: var(--doc-font);
    font-size: 0.9rem; 
    letter-spacing: 3px; 
    opacity: 0.8; 
    margin-top: 10px; 
}

.sidebar-header { 
    font-family: var(--doc-font);
    font-size: 0.9rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--gold-accent); 
    border-bottom: 1px solid rgba(255,255,255,0.15); 
    padding-bottom: 0.5rem; 
    margin-top: 2rem; 
    margin-bottom: 1rem; 
}

/* =========================================
   3. RESUME COMPONENTS
   ========================================= */
.resume-paper { 
    background: white; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); 
    min-height: 297mm; 
    margin-top: 2rem; 
    border-radius: 4px; 
    overflow: hidden; 
    display: flex; 
    flex-wrap: wrap; 
}
.sidebar-wrapper { background-color: var(--sidebar-bg); color: white; min-height: 100%; padding: 3.5rem 2.5rem; width: 33.333%; }
.main-content-wrapper { padding: 4rem 3.5rem; width: 66.666%; }

/* Contacts */
.contact-row { display: flex; align-items: flex-start; margin-bottom: 0.8rem; color: rgba(255,255,255,0.9); }
.contact-icon { width: 20px; text-align: center; color: var(--gold-accent); margin-right: 12px; font-size: 1rem; flex-shrink: 0; margin-top: 3px; }
.contact-input { font-size: 0.95rem; font-weight: 400; color: white; word-break: break-word; white-space: pre-wrap; line-height: 1.4; }

/* Timeline / Experience */
.timeline-role { font-family: var(--doc-font); font-weight: 700; font-size: 1.2rem; color: #0b1120; }
.timeline-date { font-family: var(--doc-font); font-weight: 700; font-size: 1rem; color: #334155; text-align: right; white-space: nowrap; }

/* FIX: Company Name forced to Gold in Editor and Print */
.timeline-company { 
    font-family: var(--doc-font); 
    font-weight: 700; 
    color: var(--gold-accent) !important; /* Forces Gold Color */
    font-size: 0.95rem; 
    margin-bottom: 0.5rem; 
}

.timeline-container { border-left: 2px solid #e2e8f0; padding-left: 1.5rem; margin-left: 8px; padding-top: 30px; position: relative; margin-top: 1.5rem; }
.timeline-badge-top { position: absolute; top: 0px; left: -36px; background: #166534; color: white; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; padding: 4px 8px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 2; }
.timeline-badge-bottom { position: absolute; bottom: -10px; left: -28px; background: #64748b; color: white; font-size: 0.65rem; font-weight: bold; text-transform: uppercase; padding: 3px 8px; border-radius: 12px; z-index: 2; }
.timeline-item { position: relative; margin-bottom: 2rem; break-inside: avoid; }
.timeline-icon { position: absolute; left: -2.1rem; top: 4px; width: 16px; height: 16px; background: white; border: 3px solid var(--gold-accent); border-radius: 50%; z-index: 1; }

/* Skills & Certs */
.skill-category-input { color: var(--gold-accent); font-weight: 800; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 0.5rem; text-align: left !important; }
.skill-item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; position: relative; }
.skill-name-input { color: white; font-size: 0.85rem; font-weight: 500; width: 50% !important; padding-right: 5px; text-align: left !important; }
.skill-bar-wrapper { width: 45%; display: flex; gap: 4px; position: relative; cursor: pointer; }
.skill-dot { height: 6px; flex: 1; background: rgba(255,255,255,0.15); border-radius: 1px; }
.skill-dot.filled:nth-of-type(-n+3) { background: #facc15 !important; }
.skill-dot.filled:nth-of-type(4) { background: #4ade80 !important; }
.skill-dot.filled:nth-of-type(5) { background: #166534 !important; }

.cert-main-card { display: flex; align-items: center; background: white; border: 1px solid #e2e8f0; border-left: 4px solid var(--gold-accent); padding: 1rem; border-radius: 0 8px 8px 0; }
.cert-main-icon-box { width: 45px; height: 45px; background: #f8fafc; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #0b1120; margin-right: 1rem; flex-shrink: 0; }
.cert-main-date-badge { background: #f1f5f9; color: #64748b; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; margin-left: 10px; }

/* Cards & Layout */
.achievement-card { position: relative; }
.highlight-box { background: #fffbeb; border-left: 5px solid var(--gold-accent); padding: 1.5rem; border-radius: 0 12px 12px 0; margin-top: 2rem; position: relative; }
.highlight-text-bg { background: rgba(255, 255, 255, 0.6); padding: 1rem; border-radius: 8px; display: block; }
.personal-details-card { background: white; border: 1px solid #e2e8f0; border-left: 4px solid #0b1120; padding: 1.5rem; border-radius: 8px; }
.beautiful-separator { height: 2px; background: linear-gradient(to right, var(--gold-accent), transparent); margin-bottom: 2rem; opacity: 0.7; }

/* Editor Inputs */
.ql-container { font-family: var(--doc-font) !important; font-size: 1rem !important; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; background: white; }
.ql-editor { font-family: var(--doc-font); padding: 0.8rem; min-height: auto; line-height: 1.6; color: #334155; overflow-y: hidden; }
.ql-toolbar { border: 1px solid #e2e8f0 !important; border-bottom: 1px solid #e2e8f0 !important; background: #f8fafc; border-top-left-radius: 4px; border-top-right-radius: 4px; }
.ql-container.ql-snow { border: 1px solid #e2e8f0 !important; border-top: none !important; }
.form-control-wrapper:focus-within .ql-toolbar, .form-control-wrapper:focus-within .ql-container { border-color: var(--gold-accent) !important; }
.form-control-ghost { background-color: transparent !important; border: 1px solid transparent; width: 100%; color: inherit; padding: 2px 5px; resize: none; overflow: hidden; transition: 0.2s; }
.form-control-ghost:hover { background-color: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.2); }
.form-control-ghost:focus { background-color: #fff !important; border-color: var(--gold-accent); outline: none; color: black !important; }
.form-control-ghost-dark { color: white; }
.form-control-ghost-dark:focus { background-color: rgba(255,255,255,0.1) !important; color: white !important; border-color: white; }
.btn-remove-card { position: absolute; top: -10px !important; right: -10px !important; z-index: 50; padding: 0; background: white; border: 1px solid #ddd; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); opacity: 0; transition: opacity 0.2s; color: #ef4444; }
.group-hover:hover .btn-remove-card { opacity: 1; }

/* UI Panels */
.theme-fab { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: #1e293b; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 20px rgba(0,0,0,0.3); cursor: pointer; z-index: 1000; border: 2px solid white; }
.theme-panel { position: fixed; bottom: 100px; right: 30px; width: 320px; background: #1e293b; color: white; padding: 20px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 1000; border: 1px solid #334155; }
.transition-transform { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.transition-transform:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important; }

/* Image Editor */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 2500; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.cropper-container { max-width: 100%; }
.profile-img-box { width: 170px; height: 170px; border-radius: 50%; border: 4px solid var(--gold-accent); margin: 0 auto 1.5rem auto; overflow: hidden; background: var(--navy-light); cursor: pointer; position: relative; }
.profile-img-box img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   4. PRINT SETTINGS
   ========================================= */
@media print {
    @page { margin: 1.25cm 0cm; size: A4; }
    
    html, body { width: 210mm !important; margin: 0 !important; padding: 0 !important; background: white !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; overflow: visible !important; height: auto !important; }

    .project-sidebar, .global-header, .theme-fab, .theme-panel, .no-print, .navbar, .btn, .ql-toolbar, .format-toolbar { display: none !important; }

    .container { max-width: 100% !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }

    .resume-paper { margin: 0 !important; box-shadow: none !important; border-radius: 0 !important; width: 100% !important; min-height: 100vh !important; display: flex !important; flex-wrap: nowrap !important; background: linear-gradient(to right, var(--sidebar-bg) 32%, white 32%) !important; -webkit-print-color-adjust: exact !important; }

    .col-lg-4 { width: 32% !important; flex: 0 0 32% !important; background-color: transparent !important; }
    .col-lg-8 { width: 68% !important; flex: 0 0 68% !important; }

    .sidebar-wrapper { padding: 40px 15px 40px 20px !important; text-align: left !important; }
    .skill-category-input, .skill-name-input { text-align: left !important; }
    .main-content-wrapper { padding: 40px 40px !important; }

    .section-group { break-inside: auto !important; page-break-inside: auto !important; display: block; margin-bottom: 2rem !important; }
    .timeline-item, .personal-details-card, .highlight-box, .card, .skill-category-wrapper, .cert-main-card { break-inside: avoid !important; page-break-inside: avoid !important; margin-bottom: 1rem !important; }

    .ql-editor { padding: 0 !important; overflow: visible !important; border: none !important; }
    .ql-container { border: none !important; }
    .print-only { display: block !important; }
    input, textarea, select { border: none !important; background: transparent !important; padding: 0 !important; resize: none; }
}

.print-only { display: none; }

/* =========================================
   5. PREVIEW MODE (New Feature)
   ========================================= */
.preview-active .no-print { display: none !important; }
/* Force print-only elements to be visible in preview, overriding the default display:none */
.preview-active .print-only { display: block !important; }

/* Hide floating UI tools in preview */
.preview-active .theme-fab, 
.preview-active .theme-panel, 
.preview-active .btn-remove-card,
.preview-active .btn-remove-tag,
.preview-active .ql-toolbar,
.preview-active .image-overlay {
    display: none !important;
}

/* Ensure inputs are hidden if they don't have the no-print class but should be hidden */
.preview-active input:not(.pd-value), 
.preview-active textarea {
    border: none !important;
    background: transparent !important;
    pointer-events: none;
}

/* Fix Quill Editor borders in preview */
.preview-active .ql-container { border: none !important; }