/* Résumé Atelier — global styles
   ----------------------------------------------------------
   Design system:
   - Typography: Inter (UI), no italic in chrome.
   - Palette: warm bone background, deep ink, amber Pro accent, indigo primary.
   - Layout: mobile-first; expands to sidebar+content layout on desktop.
*/

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0;
    background: #F4F1EC;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1c1a17;
    overscroll-behavior-y: contain;
    font-feature-settings: "cv11", "ss01";
}
button { font-family: inherit; }
input, textarea { font-family: inherit; font-style: normal !important; }
::-webkit-scrollbar { width: 0; height: 0; }

/* No italic in app chrome — but allow italic INSIDE the resume preview */
button, input, textarea, h1, h2, h3, h4, h5, h6, label, p, span, div {
    font-style: normal;
}
.cv [style*="italic"], .cv em, .cv i {
    font-style: italic;
}

/* Loading splash */
.app-loading {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #F4F1EC;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(0,0,0,0.08);
    border-top-color: #6E5BD0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }
@keyframes slideUp { from { transform: translateY(100%);} to { transform: translateY(0);} }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ios-tap:active { opacity: 0.5; transition: opacity 0.05s; }
.ios-list-row:active { background: rgba(120,120,128,0.18) !important; }

.cv ul { padding-left: 18px; }
.cv li { margin-bottom: 2px; }

.cv-watermark {
    position: absolute; inset: 0;
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    z-index: 5;
}
.cv-watermark::before {
    content: attr(data-text);
    font-family: "Inter", sans-serif;
    font-weight: 800;
    font-size: 56px;
    letter-spacing: 0.15em;
    color: rgba(110, 91, 208, 0.16);
    transform: rotate(-28deg);
    white-space: nowrap;
    text-transform: uppercase;
}

/* ----------------------------------------------------------
   Layout: shell with optional sidebar
----------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: #F4F1EC;
}

/* Mobile (default) — single 430px column, no sidebar */
.app-sidebar { display: none; }
.app-shell {
    overflow-x: hidden;             /* prevent any inner element from causing horizontal scroll */
}
.app-main {
    flex: 1;
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
    background: #FBF8F2;
    min-height: 100vh;
    box-shadow: 0 0 60px rgba(28,26,23,0.08);
    position: relative;
    overflow-x: hidden;             /* safety net for any inner template overflow */
}

/* Desktop — sidebar + wide content */
@media (min-width: 900px) {
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: 260px;
        flex-shrink: 0;
        background: #1c1a17;
        color: #F4F1EC;
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 28px 20px;
        overflow-y: auto;
    }
    .app-main {
        max-width: none;
        margin: 0;
        background: #F4F1EC;
        box-shadow: none;
    }
    .app-main-inner {
        max-width: 980px;
        margin: 0 auto;
        padding: 24px 20px 40px;
    }
    .resume-frame-wrap {
        max-width: 920px;
        margin: 0 auto;
    }
}

/* Sidebar internals */
.sidebar-brand {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    color: #F4F1EC;
}
.sidebar-tagline {
    font-size: 11px;
    color: rgba(244,241,236,0.5);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 28px;
}
.sidebar-section-label {
    font-size: 10.5px;
    color: rgba(244,241,236,0.4);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 18px 4px 8px;
    font-weight: 600;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(244,241,236,0.78);
    cursor: pointer;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.sidebar-nav-item:hover {
    background: rgba(244,241,236,0.06);
    color: #F4F1EC;
}
.sidebar-nav-item.active {
    background: #6E5BD0;
    color: #fff;
}
.sidebar-nav-item.disabled {
    opacity: 0.35;
    cursor: default;
}
.sidebar-nav-item.disabled:hover {
    background: transparent;
    color: rgba(244,241,236,0.78);
}
.sidebar-nav-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 14px;
}
.sidebar-pro-badge {
    display: inline-block;
    background: #d4af7a;
    color: #1c1a17;
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-left: auto;
}
.sidebar-user {
    margin-top: auto;
    padding: 14px;
    border-radius: 10px;
    background: rgba(244,241,236,0.05);
    border: 1px solid rgba(244,241,236,0.06);
}
.sidebar-user-email {
    font-size: 12px;
    color: rgba(244,241,236,0.85);
    font-weight: 500;
    word-break: break-all;
    margin-bottom: 8px;
    line-height: 1.3;
}
.sidebar-user-action {
    font-size: 12px;
    color: #d4af7a;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sidebar-upgrade-card {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6E5BD0 0%, #5544b8 100%);
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s;
}
.sidebar-upgrade-card:hover { transform: translateY(-1px); }
.sidebar-upgrade-title {
    font-size: 13px; font-weight: 700; margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px;
}
.sidebar-upgrade-desc {
    font-size: 11.5px; opacity: 0.9; line-height: 1.4;
}
