/* =============================================
   SAMA CV — styles.css
   ============================================= */

/* ---------- Variables & Themes ---------- */
:root {
    --primary-color: #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --secondary-color: #64748b;
    --text-color:   #1f2937;
    --text-light:   #6b7280;
    --bg-color:     #ffffff;
    --bg-light:     #f8fafc;
    --border-color: #e5e7eb;
    --shadow:       0 4px 6px -1px rgba(0,0,0,.08);
    --shadow-lg:    0 10px 25px -5px rgba(0,0,0,.12);
    --radius:       10px;
    --transition:   all .25s ease;
    --font-body:    'Plus Jakarta Sans', sans-serif;
    --font-display: 'Fraunces', serif;
}

[data-theme="blue"]   { --primary-color:#2563eb; --primary-dark:#1d4ed8; --primary-light:#eff6ff; }
[data-theme="green"]  { --primary-color:#059669; --primary-dark:#047857; --primary-light:#ecfdf5; }
[data-theme="purple"] { --primary-color:#7c3aed; --primary-dark:#6d28d9; --primary-light:#f5f3ff; }
[data-theme="red"]    { --primary-color:#dc2626; --primary-dark:#b91c1c; --primary-light:#fef2f2; }

/* ---------- Reset ---------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

.container { max-width:1280px; margin:0 auto; padding:0 24px; }

/* ---------- Header ---------- */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    padding: 1.75rem 0;
    box-shadow: var(--shadow-lg);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex: 1;
}

.users-stat {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.stat-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    opacity: 1;
    font-family: 'Courier New', monospace;
}

.logo {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.header-content { text-align: center; }

.header-content h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.header-content h1 span {
    font-weight: 300;
    font-style: italic;
    opacity: .85;
}

.header-content p {
    font-size: 1rem;
    opacity: .85;
    margin-top: .25rem;
    font-weight: 400;
}

/* ---------- Header Right & Admin ---------- */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Hamburger Menu */
.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
}

.hamburger-dropdown.active {
    display: flex;
}

.hamburger-dropdown .admin-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    border-radius: 0;
    padding: 1rem;
    text-align: left;
    font-size: 0.95rem;
    transition: background 0.2s ease;
    backdrop-filter: none;
}

.hamburger-dropdown .admin-btn:hover {
    background: var(--primary-light);
    border-color: transparent;
}

/* Admin Modal */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.admin-modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
}

.admin-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.admin-modal-close:hover {
    color: var(--primary-color);
}

.admin-modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

.admin-form .form-group {
    margin-bottom: 1.5rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.admin-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.admin-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-login-btn, .admin-logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.admin-login-btn:hover {
    background: var(--primary-dark);
}

.admin-logout-btn {
    background: #dc2626;
    margin-top: 0.5rem;
}

.admin-logout-btn:hover {
    background: #b91c1c;
}

/* ---------- Controls Bar ---------- */
.controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.control-group {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.control-group label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.theme-selector { display:flex; gap:.4rem; }

.theme-btn {
    padding: .4rem .9rem;
    border: 1.5px solid var(--border-color);
    background: none;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: .825rem;
    font-weight: 500;
    font-family: var(--font-body);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.theme-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#language-select {
    padding: .4rem .75rem;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: .9rem;
    cursor: pointer;
    transition: var(--transition);
}

#language-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ---------- Builder Layout ---------- */
.builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    align-items: start;
}

/* ---------- Form Section ---------- */
.form-section {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    max-height: 82vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.form-section::-webkit-scrollbar { width: 5px; }
.form-section::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ---------- Tabs ---------- */
.form-tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: .5rem .9rem;
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-weight: 500;
    font-size: .85rem;
    font-family: var(--font-body);
}

.tab-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.tab-btn:hover:not(.active) {
    background: var(--bg-light);
    color: var(--text-color);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content > h3 {
    font-size: 1.2rem;
    margin-bottom: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ---------- Form Elements ---------- */
.form-group { margin-bottom: 1.25rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 500;
    font-size: .875rem;
    color: var(--text-color);
}

input, textarea, select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--text-color);
    background: var(--bg-color);
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

input.error, textarea.error { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

textarea { resize: vertical; min-height: 90px; }

/* ---------- Error Messages ---------- */
.error-message {
    display: block;
    color: #dc2626;
    font-size: .8rem;
    margin-top: .3rem;
    opacity: 0;
    transition: opacity .25s;
}

.error-message.show { opacity: 1; }

/* ---------- Photo Preview ---------- */
.photo-preview {
    margin-top: .75rem;
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: .8rem;
    overflow: hidden;
    transition: var(--transition);
}

.photo-preview img { width:100%; height:100%; object-fit:cover; }

/* ---------- Social Links ---------- */
.social-link {
    display: grid;
    grid-template-columns: 120px 1fr 36px;
    gap: .5rem;
    align-items: center;
    margin-bottom: .6rem;
}

.remove-social {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.remove-social:hover { background: #dc2626; color: #fff; }

/* ---------- Buttons ---------- */
button { cursor: pointer; transition: var(--transition); font-family: var(--font-body); }

.suggest-btn {
    margin-top: .5rem;
    padding: .45rem 1rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 6px;
    font-size: .825rem;
    font-weight: 600;
}

.suggest-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.remove-btn {
    margin-top: .75rem;
    padding: .45rem .9rem;
    background: #fee2e2;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 6px;
    font-size: .825rem;
    font-weight: 600;
}

.remove-btn:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.add-btn {
    margin-top: .5rem;
    padding: .5rem 1rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border: 1.5px dashed var(--primary-color);
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    width: 100%;
}

.add-btn:hover { background: var(--primary-light); }

/* Item separators */
.experience-item, .education-item, .skill-item, .project-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

/* ---------- Skill Level Range ---------- */
.skill-level { cursor: pointer; accent-color: var(--primary-color); }
.skill-level-display {
    display: inline-block;
    margin-left: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ---------- Preview Section ---------- */
.preview-section {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    position: sticky;
    top: 1.5rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.template-selector { display:flex; gap:.4rem; }

.template-btn {
    padding: .4rem .85rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 6px;
    font-size: .825rem;
    font-weight: 500;
    color: var(--text-light);
}

.template-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.template-btn:hover:not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.download-btn {
    padding: .55rem 1.25rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: .875rem;
    letter-spacing: .02em;
}

.download-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.download-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- CV Preview ---------- */
.cv-preview {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 1.75rem;
    background: #fff;
    min-height: 400px;
    font-size: .875rem;
    line-height: 1.6;
    overflow: hidden;
    word-break: break-word;
}

.status-text {
    display: inline-block;
    margin-left: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
}

/* =============================================
   CV TEMPLATES
   ============================================= */

/* --- MODERN --- */
.cv-preview.modern .cv-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid var(--primary-color);
    align-items: flex-start;
}

.cv-preview.modern .cv-photo { flex-shrink: 0; }

.cv-preview.modern .cv-photo img,
.cv-preview.modern .no-photo {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: .75rem;
}

.cv-preview.modern .cv-info h1 {
    font-size: 1.6rem;
    margin: 0 0 .2rem;
    color: var(--text-color);
    font-family: var(--font-display);
    font-weight: 600;
}

.cv-preview.modern .cv-info h2 {
    font-size: 1rem;
    color: var(--primary-color);
    margin: 0 0 .75rem;
    font-weight: 500;
}

.cv-preview.modern .cv-contact {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: .8rem;
    color: var(--text-light);
}

.cv-preview.modern .cv-social {
    display: flex;
    gap: .75rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.cv-preview.modern .cv-social a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 500;
}

.cv-preview.modern .cv-section { margin-bottom: 1.25rem; }

.cv-preview.modern .cv-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: .6rem;
    padding-bottom: .3rem;
    border-bottom: 1.5px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.cv-preview.modern .cv-item { margin-bottom: 1rem; }

.cv-preview.modern .cv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .25rem;
}

.cv-preview.modern .cv-item-header h4 {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-color);
}

.cv-preview.modern .cv-item-header span {
    color: var(--text-light);
    font-size: .78rem;
    text-align: right;
    flex-shrink: 0;
    margin-left: .5rem;
}

.cv-preview.modern .cv-skills { display: grid; gap: .6rem; }

.cv-preview.modern .cv-skill {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cv-preview.modern .cv-skill span { min-width: 100px; font-size: .82rem; }

.cv-preview.modern .skill-bar {
    flex: 1;
    height: 7px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.cv-preview.modern .skill-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
}

.cv-preview.modern .project-tech {
    font-style: italic;
    color: var(--text-light);
    font-size: .78rem;
    margin-top: .3rem;
}

.cv-preview.modern p { font-size: .82rem; color: var(--text-light); }

/* --- CLASSIC --- */
.cv-preview.classic { font-family: 'Times New Roman', Georgia, serif; }

.cv-preview.classic .cv-header-classic {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #111;
}

.cv-preview.classic .cv-header-classic h1 {
    font-size: 2rem;
    margin-bottom: .3rem;
    color: #111;
}

.cv-preview.classic .cv-header-classic h2 {
    font-size: 1.1rem;
    font-style: italic;
    color: #555;
}

.cv-preview.classic .cv-content-classic {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

.cv-preview.classic .cv-sidebar {
    background: #f9f9f9;
    padding: .9rem;
    border-right: 1px solid #ddd;
}

.cv-preview.classic .cv-photo-classic {
    width: 100%;
    max-width: 160px;
    height: auto;
    margin-bottom: .75rem;
    border: 1px solid #ccc;
    display: block;
}

.cv-preview.classic .cv-sidebar h3 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .4rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: .25rem;
    color: #333;
}

.cv-preview.classic .cv-sidebar p {
    font-size: .78rem;
    margin-bottom: .3rem;
    color: #444;
}

.cv-preview.classic .cv-sidebar a { color: var(--primary-color); text-decoration: none; }

.cv-preview.classic .cv-main .cv-section { margin-bottom: 1.25rem; }

.cv-preview.classic .cv-main .cv-section h3 {
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .6rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: .3rem;
    color: #222;
}

.cv-preview.classic .cv-item { margin-bottom: 1rem; }
.cv-preview.classic .cv-item h4 { margin: 0 0 .15rem; font-size: .9rem; color: #111; }
.cv-preview.classic .cv-company, .cv-preview.classic .cv-school { font-weight: bold; font-size: .82rem; margin-bottom: .1rem; color: #333; }
.cv-preview.classic .cv-dates { font-style: italic; color: #777; font-size: .78rem; margin-bottom: .3rem; }
.cv-preview.classic p { font-size: .82rem; color: #444; }

/* --- MINIMAL --- */
.cv-preview.minimal { font-family: var(--font-body); border: none; box-shadow: none; background: #fff; }

.cv-preview.minimal .cv-header-minimal {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cv-preview.minimal .cv-header-minimal h1 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: .25rem;
    color: var(--text-color);
}

.cv-preview.minimal .cv-header-minimal p {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: .75rem;
    font-weight: 500;
}

.cv-preview.minimal .cv-contact-minimal {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--text-light);
}

.cv-preview.minimal .cv-section-minimal { margin-bottom: 1.5rem; }

.cv-preview.minimal .cv-section-minimal h3 {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--primary-color);
    margin-bottom: .75rem;
}

.cv-preview.minimal .cv-item-minimal { margin-bottom: 1rem; }

.cv-preview.minimal .cv-item-minimal h4 {
    margin: 0 0 .2rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-color);
}

.cv-preview.minimal .cv-item-minimal h4 span {
    font-weight: 400;
    color: var(--text-light);
}

.cv-preview.minimal .cv-dates-minimal {
    color: var(--text-light);
    font-size: .78rem;
    margin-bottom: .3rem;
}

.cv-preview.minimal p { font-size: .82rem; color: var(--text-light); }

/* =============================================
   RESPONSIVE
   ============================================= */

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

    .form-section {
        max-height: none;
        overflow-y: visible;
        order: 1;
        width: 100%;
    }

    .preview-section {
        position: static;
        order: 2;
        width: 100%;
        margin-top: 1.5rem;
    }
}

@media (max-width: 640px) {
    .header-content h1 { font-size: 1.9rem; }
    
    .header-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .header-left {
        width: auto;
        justify-content: flex-start;
    }
    
    .header-right {
        width: auto;
        justify-content: flex-end;
    }
    
    .users-stat {
        justify-content: flex-end;
    }
    
    .admin-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1rem;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        min-width: 0;
    }

    .theme-selector {
        flex-wrap: wrap;
        gap: .5rem;
        width: 100%;
        min-width: 0;
    }

    .theme-btn {
        flex: 1 1 100px;
        min-width: 90px;
        max-width: 100%;
    }

    .form-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: .75rem;
        -webkit-overflow-scrolling: touch;
        min-width: 0;
    }

    .tab-btn {
        flex-shrink: 0;
        min-width: 70px;
    }

    .form-row {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .social-link {
        grid-template-columns: 1fr auto;
        min-width: 0;
    }

    .social-platform,
    .social-url {
        width: 100%;
        min-width: 0;
    }

    .form-group {
        width: 100%;
    }

    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }

    .template-selector {
        justify-content: center;
    }

    .download-btn {
        width: 100%;
        text-align: center;
    }

    .cv-preview {
        padding: 1rem;
        font-size: .8rem;
    }

    .cv-preview.modern .cv-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cv-preview.modern .cv-contact {
        align-items: center;
    }

    .cv-preview.modern .cv-social {
        justify-content: center;
    }

    .cv-preview.modern .cv-item-header {
        flex-direction: column;
        gap: .15rem;
    }

    .cv-preview.modern .cv-item-header span {
        text-align: left;
        margin-left: 0;
    }

    .cv-preview.classic .cv-content-classic {
        grid-template-columns: 1fr;
    }

    .cv-preview.classic .cv-sidebar {
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-bottom: .75rem;
        margin-bottom: .75rem;
    }

    .cv-preview.minimal .cv-contact-minimal {
        flex-direction: column;
        gap: .3rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .builder {
        gap: 1rem;
        min-width: 0;
    }

    .form-section,
    .preview-section {
        padding: 1rem;
        min-width: 0;
    }

    .controls,
    .control-group,
    .theme-selector,
    .form-tabs,
    .form-row,
    .social-link {
        min-width: 0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select,
    .social-url,
    .social-platform {
        font-size: .95rem;
    }

    .theme-btn,
    .template-btn,
    .download-btn,
    .suggest-btn,
    .add-btn,
    .remove-btn {
        width: 100%;
        min-width: 0;
    }

    .form-tabs {
        gap: .35rem;
    }
}


/* ---------- PDF Print hints ---------- */
.cv-section, .cv-item, .cv-section-minimal, .cv-item-minimal {
    page-break-inside: avoid;
}