/* =====================================================
   cv.css - أنماط السيرة الذاتية (محسّنة واحترافية)
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arimo', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #dce4f0 0%, #c8d4e6 100%);
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== الهيدر الثابت ===== */
.cv-toolbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 16px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.cv-main {
    padding-top: 80px !important;
    padding-bottom: 60px;
    min-height: 100vh;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== تسجيل الدخول مطلوب ===== */
.login-required-cv {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    max-width: 500px;
    margin: 60px auto;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-required-cv .icon {
    font-size: 4.5rem;
    color: #3E67A3;
    margin-bottom: 20px;
    display: block;
}

.login-required-cv h3 {
    color: #3E67A3;
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.login-required-cv p {
    color: #666;
    font-size: 1.05rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-login-cv {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #3E67A3, #03A180);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(62, 103, 163, 0.3);
}

.btn-login-cv:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(62, 103, 163, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-login-cv:active {
    transform: translateY(-1px);
}

/* ===== أزرار الهيدر ===== */
.cv-toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cv-toolbar-left h1 {
    font-size: 1.3rem;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.cv-toolbar-left h1 i {
    color: #3E67A3;
    font-size: 1.2rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.lang-switch a {
    color: #888;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border: 1px solid transparent;
}

.lang-switch a:hover {
    background: #f0f0f0;
    color: #1a1a1a;
    border-color: #e0e0e0;
}

.lang-switch a.active {
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(135deg, #3E67A3, #2a4d7a);
    border-color: #3E67A3;
    box-shadow: 0 2px 8px rgba(62, 103, 163, 0.3);
}

.lang-switch span {
    color: #ddd;
    font-weight: 300;
}

.cv-toolbar-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #1a1a1a, #333333);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover {
    background: linear-gradient(135deg, #333333, #1a1a1a);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
}

.btn-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.auto-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
    padding: 6px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    border: 1px solid #eee;
}

.auto-save-indicator i {
    font-size: 0.75rem;
}

.auto-save-indicator.saved {
    color: #2e7d32;
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.auto-save-indicator.saving {
    color: #f57c00;
    background: #fff3e0;
    border-color: #ffe0b2;
}

.auto-save-indicator.error {
    color: #d32f2f;
    background: #ffebee;
    border-color: #ffcdd2;
}

/* ===== التخطيط الرئيسي ===== */
.cv-layout {
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 30px;
    align-items: start;
}

/* ===== الشريط الجانبي ===== */
.cv-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    align-self: start;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f0f0f0;
}

.cv-sidebar::-webkit-scrollbar {
    width: 5px;
}

.cv-sidebar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.cv-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.cv-sidebar::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.cv-sidebar h2 {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.cv-sidebar h2 i {
    color: #3E67A3;
    font-size: 1rem;
}

/* ===== حقول الإدخال ===== */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    color: #1a1a1a;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3E67A3;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(62, 103, 163, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

.form-group textarea {
    min-height: 60px;
    resize: vertical;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    padding-left: 38px;
}

[dir="rtl"] .form-group select {
    background-position: right 14px center;
    padding-right: 38px;
    padding-left: 14px;
}

/* ===== عناوين الأقسام ===== */
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 22px 0 12px 0;
    padding-top: 14px;
    border-top: 2px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-title i {
    color: #3E67A3;
    font-size: 0.85rem;
}

.section-move-btn {
    background: #f0f0f0;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-weight: 600;
}

.section-move-btn:hover {
    background: #ddd;
    color: #1a1a1a;
    transform: scale(1.05);
}

/* ===== قائمة ترتيب الأقسام ===== */
.section-order-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1.5px dashed #ddd;
}

.section-order-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.section-order-item:hover {
    border-color: #3E67A3;
    background: #f5f8ff;
    box-shadow: 0 2px 8px rgba(62, 103, 163, 0.1);
}

.section-order-item:active {
    cursor: grabbing;
}

.section-order-item i {
    color: #999;
    font-size: 0.7rem;
}

/* ===== بطاقات العناصر ===== */
.item-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #eee;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.item-card .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: 1px solid #eee;
    color: #999;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 5px 9px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    line-height: 1;
}

[dir="rtl"] .item-card .remove-btn {
    right: auto;
    left: 10px;
}

.item-card .remove-btn:hover {
    color: #d32f2f;
    background: #ffebee;
    border-color: #ffcdd2;
    transform: scale(1.1);
}

.item-card .form-group {
    margin-bottom: 8px;
}

.item-card .form-group:last-child {
    margin-bottom: 0;
}

.item-card .form-group input,
.item-card .form-group textarea {
    background: #ffffff;
    border-color: #e8e8e8;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.item-card .form-group input:focus,
.item-card .form-group textarea:focus {
    border-color: #3E67A3;
    box-shadow: 0 0 0 3px rgba(62, 103, 163, 0.08);
}

/* ===== بطاقات المهارات ===== */
.skill-item-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #eee;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item-card:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.skill-item-card .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: 1px solid #eee;
    color: #999;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 5px 9px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    line-height: 1;
}

[dir="rtl"] .skill-item-card .remove-btn {
    right: auto;
    left: 10px;
}

.skill-item-card .remove-btn:hover {
    color: #d32f2f;
    background: #ffebee;
    border-color: #ffcdd2;
    transform: scale(1.1);
}

.skill-item-card .form-group {
    margin-bottom: 8px;
}

.skill-item-card .form-group:last-child {
    margin-bottom: 0;
}

.skill-item-card .form-group input,
.skill-item-card .form-group textarea {
    background: #ffffff;
    border-color: #e8e8e8;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.skill-item-card .form-group input:focus,
.skill-item-card .form-group textarea:focus {
    border-color: #3E67A3;
    box-shadow: 0 0 0 3px rgba(62, 103, 163, 0.08);
}

/* ===== زر الإضافة ===== */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #3E67A3, #2a4d7a);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 6px;
    font-family: inherit;
    box-shadow: 0 3px 12px rgba(62, 103, 163, 0.25);
}

.btn-add:hover {
    background: linear-gradient(135deg, #2a4d7a, #3E67A3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 103, 163, 0.35);
}

.btn-add:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(62, 103, 163, 0.2);
}

/* ===== منطقة معاينة السيرة الذاتية ===== */
.cv-preview-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ===== حاوية المعاينة (الصفحات) ===== */
.cv-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 100%;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    min-height: auto;
    transition: all 0.3s ease;
}

/* ===== صفحة A4 الواحدة ===== */
.cv-page {
    width: 794px;
    max-width: 100%;
    min-height: 1123px;
    background: #ffffff;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    direction: inherit;
    text-align: inherit;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow: hidden;
    border-radius: 2px;
}

.cv-page .page-content {
    padding: 15px 30px 30px 30px;
    min-height: 1123px;
    box-sizing: border-box;
}

.cv-page + .cv-page {
    border-top: 2px dashed #ccc;
}

.cv-page .page-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

[dir="rtl"] .cv-page {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] .cv-page {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] .cv-page .cv-item-header {
    flex-direction: row;
}

[dir="rtl"] .cv-page .cv-contact {
    justify-content: center;
}

[dir="rtl"] .cv-page .cv-skills .skill-item ul li {
    padding-right: 16px;
    padding-left: 0;
}

[dir="rtl"] .cv-page .cv-skills .skill-item ul li span {
    left: auto;
    right: 0;
}

/* =====================================================
   التجاوب مع جميع الشاشات
   ===================================================== */

@media (min-width: 1600px) {
    .container {
        max-width: 1500px;
    }
}

@media (max-width: 1400px) {
    .cv-layout {
        grid-template-columns: 400px 1fr;
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .cv-layout {
        grid-template-columns: 1fr;
    }

    .cv-sidebar {
        position: static;
        max-height: none;
        order: 2;
    }

    .cv-preview-wrapper {
        order: 1;
    }
}

/* =====================================================
   شاشات التابلت (768px - 1024px)
   ===================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .cv-toolbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 12px 18px;
    }

    .cv-toolbar-left {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
        flex-shrink: 1;
        min-width: 0;
    }

    .cv-toolbar-left h1 {
        font-size: 1rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .lang-switch {
        font-size: 0.8rem;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .lang-switch a {
        padding: 3px 8px;
    }

    .cv-toolbar-right {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .btn-download {
        padding: 8px 16px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .auto-save-indicator {
        font-size: 0.7rem;
        padding: 3px 10px;
        white-space: nowrap;
    }
}

@media (max-width: 900px) {
    .cv-page {
        width: 100%;
        min-height: auto;
    }

    .cv-page .page-content {
        min-height: auto;
    }
}

/* =====================================================
   الجوالات (768px وأقل) - كل شي بعرض الشاشة كامل
   ===================================================== */
@media (max-width: 768px) {
    .cv-main {
        padding-top: 75px !important;
        padding-bottom: 40px;
    }

    /* ===== الهيدر: يمتد من أقصى اليمين لأقصى اليسار ===== */
    .cv-toolbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px 16px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    html[lang="ar"] .cv-toolbar,
    body[dir="rtl"] .cv-toolbar,
    [dir="rtl"] .cv-toolbar {
        direction: rtl !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    html[lang="en"] .cv-toolbar,
    body[dir="ltr"] .cv-toolbar,
    [dir="ltr"] .cv-toolbar {
        direction: ltr !important;
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    .cv-toolbar-left {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    html[lang="ar"] .cv-toolbar-left,
    body[dir="rtl"] .cv-toolbar-left,
    [dir="rtl"] .cv-toolbar-left {
        direction: rtl !important;
        justify-content: flex-start !important;
        text-align: right !important;
    }

    html[lang="en"] .cv-toolbar-left,
    body[dir="ltr"] .cv-toolbar-left,
    [dir="ltr"] .cv-toolbar-left {
        direction: ltr !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .cv-toolbar-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        flex: 0 1 auto !important;
    }

    html[lang="ar"] .cv-toolbar-right,
    body[dir="rtl"] .cv-toolbar-right,
    [dir="rtl"] .cv-toolbar-right {
        direction: rtl !important;
        justify-content: flex-end !important;
    }

    html[lang="en"] .cv-toolbar-right,
    body[dir="ltr"] .cv-toolbar-right,
    [dir="ltr"] .cv-toolbar-right {
        direction: ltr !important;
        justify-content: flex-end !important;
    }

    .cv-toolbar-left h1 {
        font-size: 0.95rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    .cv-toolbar-left h1 i {
        font-size: 0.9rem !important;
    }

    .lang-switch {
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        gap: 3px !important;
    }

    .lang-switch a {
        padding: 3px 7px !important;
    }

    .btn-download {
        padding: 7px 14px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        gap: 5px !important;
    }

    .auto-save-indicator {
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        white-space: nowrap !important;
    }

    /* ===== السيرة الذاتية بعرض الشاشة كامل مثل الهيدر ===== */
    .container {
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .cv-layout {
        gap: 0 !important;
        padding: 0 !important;
    }

    .cv-preview-wrapper {
        padding: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    .cv-preview {
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .cv-page {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        min-height: auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
    }

    .cv-page .page-content {
        padding: 15px 18px 25px 18px !important;
        min-height: auto !important;
    }

    .cv-page + .cv-page {
        border-top: 2px dashed #ddd !important;
    }

    /* ===== خانة تعديل السيرة الذاتية بعرض الشاشة كامل ===== */
    .cv-sidebar {
        padding: 20px 16px !important;
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid #eee !important;
        box-shadow: none !important;
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        top: 70px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .cv-sidebar h2 {
        font-size: 1rem !important;
    }

    .login-required-cv {
        padding: 50px 25px;
        margin: 30px 15px;
        border-radius: 20px;
    }

    .login-required-cv h3 {
        font-size: 1.4rem;
    }

    .login-required-cv .icon {
        font-size: 3.5rem;
    }

    .btn-login-cv {
        padding: 14px 32px;
        font-size: 1rem;
    }
}

/* شاشات الجوال المتوسطة */
@media (max-width: 600px) {
    .cv-toolbar {
        padding: 10px 12px !important;
        gap: 6px !important;
    }

    .cv-toolbar-left {
        gap: 8px !important;
    }

    .cv-toolbar-left h1 {
        font-size: 0.85rem !important;
    }

    .btn-download {
        padding: 6px 12px !important;
        font-size: 0.7rem !important;
    }

    .lang-switch {
        font-size: 0.7rem !important;
    }

    .lang-switch a {
        padding: 2px 6px !important;
    }

    .auto-save-indicator {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }

    .cv-sidebar {
        padding: 16px 12px !important;
    }

    .cv-page .page-content {
        padding: 12px 14px 20px 14px !important;
    }

    .section-order-list {
        gap: 5px;
    }

    .section-order-item {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* شاشات الجوال الصغيرة */
@media (max-width: 480px) {
    .cv-main {
        padding-top: 70px !important;
    }

    .cv-toolbar {
        padding: 8px 10px !important;
        gap: 5px !important;
    }

    .cv-toolbar-left {
        gap: 6px !important;
    }

    .cv-toolbar-left h1 {
        font-size: 0.8rem !important;
    }

    .cv-toolbar-left h1 i {
        font-size: 0.75rem !important;
    }

    .btn-download {
        padding: 5px 10px !important;
        font-size: 0.65rem !important;
        gap: 4px !important;
    }

    .lang-switch {
        font-size: 0.65rem !important;
    }

    .lang-switch a {
        padding: 2px 5px !important;
    }

    .auto-save-indicator {
        font-size: 0.55rem !important;
        padding: 2px 5px !important;
    }

    .cv-page .page-content {
        padding: 10px 12px 15px 12px !important;
    }

    .cv-sidebar {
        padding: 14px 10px !important;
    }

    .cv-sidebar h2 {
        font-size: 0.95rem !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    .item-card {
        padding: 12px !important;
    }

    .skill-item-card {
        padding: 12px !important;
    }

    .login-required-cv {
        padding: 40px 20px;
        margin: 20px 12px;
    }

    .login-required-cv .icon {
        font-size: 3rem;
    }

    .login-required-cv h3 {
        font-size: 1.2rem;
    }

    .btn-login-cv {
        padding: 12px 28px;
        font-size: 0.95rem;
    }

    .section-order-list {
        flex-direction: column;
    }
}

/* شاشات الجوال الصغيرة جدًا */
@media (max-width: 360px) {
    .cv-main {
        padding-top: 65px !important;
    }

    .cv-toolbar {
        padding: 6px 8px !important;
        gap: 4px !important;
    }

    .cv-toolbar-left h1 {
        font-size: 0.75rem !important;
    }

    .btn-download {
        padding: 4px 8px !important;
        font-size: 0.6rem !important;
    }

    .lang-switch {
        font-size: 0.6rem !important;
    }

    .auto-save-indicator {
        font-size: 0.55rem !important;
        padding: 2px 4px !important;
    }

    .cv-page .page-content {
        padding: 8px 10px 12px 10px !important;
    }

    .cv-sidebar {
        padding: 12px 8px !important;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 7px 8px !important;
        font-size: 0.75rem !important;
    }
}

/* =====================================================
   إعدادات الطباعة
   ===================================================== */
@media print {
    @page {
        margin: 0 !important;
        size: A4;
    }

    .cv-toolbar,
    .cv-sidebar,
    .no-print {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }

    .cv-layout {
        display: block !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .cv-preview-wrapper {
        background: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
        min-height: auto !important;
        display: block !important;
        border-radius: 0 !important;
    }

    .cv-preview {
        display: block !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .cv-page {
        border: none !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        background: white !important;
        box-shadow: none !important;
        width: 100% !important;
        min-height: 1123px !important;
        page-break-after: always;
        page-break-inside: avoid;
        border-top: none !important;
        overflow: visible !important;
        position: relative !important;
        direction: inherit !important;
        text-align: inherit !important;
        border-radius: 0 !important;
    }

    .cv-page:last-child {
        page-break-after: auto;
    }

    .cv-page .page-content {
        padding: 15px 30px 30px 30px !important;
        min-height: 1123px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    html[lang="ar"] .cv-page,
    html[lang="ar"] .cv-page .page-content,
    html[lang="ar"] .cv-page *,
    [dir="rtl"] .cv-page,
    [dir="rtl"] .cv-page .page-content,
    [dir="rtl"] .cv-page * {
        direction: rtl !important;
        text-align: right !important;
    }

    html[lang="en"] .cv-page,
    html[lang="en"] .cv-page .page-content,
    html[lang="en"] .cv-page *,
    [dir="ltr"] .cv-page,
    [dir="ltr"] .cv-page .page-content,
    [dir="ltr"] .cv-page * {
        direction: ltr !important;
        text-align: left !important;
    }

    html[lang="ar"] .cv-page .cv-contact,
    html[lang="ar"] .cv-page .cv-contact *,
    [dir="rtl"] .cv-page .cv-contact,
    [dir="rtl"] .cv-page .cv-contact * {
        direction: rtl !important;
        text-align: center !important;
    }

    html[lang="en"] .cv-page .cv-contact,
    html[lang="en"] .cv-page .cv-contact *,
    [dir="ltr"] .cv-page .cv-contact,
    [dir="ltr"] .cv-page .cv-contact * {
        direction: ltr !important;
        text-align: center !important;
    }

    .cv-main {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: auto !important;
    }

    .container {
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cv-toolbar *,
    .cv-sidebar * {
        display: none !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
}