/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:wght@400;600;700&family=Roboto:wght@300;400;500;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #1e293b;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Standard Real-time A4 Paper Canvas Frame (210mm x 297mm / 794px x 1123px) */
#cvPreviewFrame {
    width: 100%;
    max-width: 794px;
    position: relative;
    overflow-x: auto;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

#cvCanvas {
    width: 794px !important;
    min-height: 1123px !important;
    transform-origin: top center !important;
    transform: scale(var(--cv-scale, 1));
    margin: 0 auto !important;
}

.a4-wrapper {
    width: 794px !important;
    min-height: 1123px !important;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
    margin: 0 auto !important;
    transition: box-shadow 0.2s ease-in-out;
}

/* Page Break Indicator Line */
.a4-page-break {
    display: none !important;
}

/* Watermark Overlay */
.watermark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.watermark-text {
    transform: rotate(-35deg);
    font-size: 4rem;
    font-weight: 900;
    color: rgba(239, 68, 68, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    user-select: none;
    white-space: nowrap;
    border: 8px dashed rgba(239, 68, 68, 0.2);
    padding: 20px 40px;
    border-radius: 16px;
}

/* Font Family Classes */
.font-inter { font-family: 'Inter', sans-serif; }
.font-roboto { font-family: 'Roboto', sans-serif; }
.font-outfit { font-family: 'Outfit', sans-serif; }
.font-playfair { font-family: 'Playfair Display', serif; }

/* ============================================= */
/*  MOBILE TAB SWITCHER (Editor - Preview)       */
/* ============================================= */
#mobile_tab_switcher {
    display: none;
}

/* Resume.io Segmented Control Pill Bar */
#mobile_tab_switcher {
    display: none;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(30, 41, 59, 0.8);
    padding: 8px 16px;
    justify-content: center;
}

@media (max-width: 1023px) {
    #mobile_tab_switcher {
        display: flex;
    }
}

.segmented-pill-box {
    background: #020617;
    border: 1px solid rgba(51, 65, 85, 0.8);
    padding: 3px;
    border-radius: 12px;
    display: inline-flex;
    width: 100%;
    max-width: 340px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mob-tab {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}
.mob-tab.active {
    color: #0f172a;
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================= */
/*  MOBILE NAVIGATION OVERLAY MENU               */
/* ============================================= */
.hamburger-btn {
    display: none !important;
}

@media (max-width: 767px) {
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        color: #cbd5e1;
        font-size: 20px;
        z-index: 60;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============================================= */
/*  RESPONSIVE: EDITOR TOOLBAR                   */
/* ============================================= */
@media (max-width: 1023px) {
    /* Header toolbar: stack into 2 rows */
    .editor-toolbar {
        flex-wrap: wrap !important;
        padding: 8px 12px !important;
        gap: 8px !important;
    }
    .editor-toolbar .toolbar-brand {
        flex: 0 0 auto;
    }
    .editor-toolbar .toolbar-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        justify-content: flex-start;
    }
    .editor-toolbar .toolbar-controls select {
        font-size: 10px;
        padding: 6px 8px;
        max-width: 140px;
    }
    .editor-toolbar .toolbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .editor-toolbar .toolbar-actions button {
        font-size: 10px;
        padding: 6px 10px;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .editor-toolbar .toolbar-brand .brand-desc {
        display: none;
    }
    .editor-toolbar .toolbar-controls select {
        max-width: 110px;
    }
    .editor-toolbar .color-swatches-group {
        display: none;
    }
}

/* ============================================= */
/*  RESPONSIVE: MAIN LAYOUT                      */
/* ============================================= */
@media (max-width: 1023px) {
    /* Full-screen panels on mobile */
    .editor-panel {
        width: 100% !important;
        border-right: none !important;
        padding: 12px !important;
    }
    .preview-panel {
        width: 100% !important;
        overflow-x: hidden !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .main-workspace {
        flex-direction: column !important;
    }
}

/* ============================================= */
/*  RESPONSIVE: FORM GRIDS                       */
/* ============================================= */
@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================= */
/*  RESPONSIVE: MODALS                           */
/* ============================================= */
.modal-overlay {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
}
.modal-overlay.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .modal-overlay > div {
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
    }
    .modal-overlay .modal-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================= */
/*  RESPONSIVE: FLOATING CHAT WIDGET             */
/* ============================================= */
@media (max-width: 640px) {
    #ai_chat_container {
        right: 8px !important;
        bottom: 8px !important;
    }
    #ai_chat_container #ai_chat_box {
        width: calc(100vw - 16px) !important;
        max-width: none;
    }
    #ai_chat_container #btn_toggle_chat span {
        display: none;
    }
}

/* ============================================= */
/*  RESPONSIVE: NAVBAR                           */
/* ============================================= */
@media (max-width: 767px) {
    .nav-desktop-links {
        display: none !important;
    }
    .nav-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ============================================= */
/*  SMOOTH TRANSITIONS                           */
/* ============================================= */
.panel-transition {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ============================================= */
/*  MOBILE-FRIENDLY TOUCH TARGETS                */
/* ============================================= */
@media (max-width: 640px) {
    button, select, input[type="file"], .cursor-pointer {
        min-height: 38px;
    }
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
}

/* Print Media Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
    }
    .no-print, .a4-page-break, #mobile_tab_switcher {
        display: none !important;
    }
    .a4-wrapper {
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        transform: none !important;
    }
    .watermark-overlay {
        display: none !important;
    }
}

/* Prevent fixed form controls from pushing item cards outside the panel. */
.item-drag-card,
.item-drag-card input,
.item-drag-card textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .item-fields-inline,
    .item-fields-inline input {
        min-width: 0;
    }
    .item-fields-skills,
    .item-fields-languages {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 8rem);
    }
    .item-fields-skills input,
    .item-fields-languages input {
        width: auto !important;
    }
}