/* מערכת הפניות שלי - עיצוב מודרני */

/* === גופנים ומשתנים === */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-gray: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
}

#form1 {
    min-height: 100%;
}

body {
    font-family: 'Heebo', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    
    /* רקע אפור-כחול עדין ומקצועי */
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 50%, #f0f9ff 100%);
    background-attachment: fixed;
}

/* שכבת overlay עדינה */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top right, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at center, rgba(147, 197, 253, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* דוטים דקורטיביים עדינים */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* טקסטים דו-לשוניים */
.text-ar {
    font-family: 'Tajawal', 'Arial', sans-serif;
    display: block;
    font-size: 1.05em;
    opacity: 0.95;
    margin-bottom: 5px;
}

.text-he {
    font-family: 'Heebo', 'Segoe UI', sans-serif;
    display: block;
    margin-bottom: 0;
}

.text-en {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.9em;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

/* עבור H2/H3 עם טקסט דו-לשוני */
h2 > .text-ar,
h3 > .text-ar {
    margin-bottom: 5px;
}

/* עבור paragraphs עם טקסט דו-לשוני */
p > .text-ar {
    margin-bottom: 5px;
}

.text-sep {
    margin: 0 5px;
    opacity: 0.6;
}

/* כפתורים עם טקסט דו-לשוני */
button .text-ar,
.btn-primary .text-ar,
.btn-secondary .text-ar,
.btn-success .text-ar {
    display: inline;
    margin: 0 3px;
}

button .text-he,
.btn-primary .text-he,
.btn-secondary .text-he,
.btn-success .text-he {
    display: inline;
    margin: 0 3px;
}

.btn-text-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.btn-text-container .text-ar {
    font-size: 0.95em;
}

.btn-text-container .text-he {
    font-size: 0.95em;
}

/* Headers עם טקסט דו-לשוני */
h1 .text-ar,
h2 .text-ar,
h3 .text-ar {
    display: inline;
    margin-left: 8px;
}

h1 .text-he,
h2 .text-he,
h3 .text-he {
    display: inline;
}

/* Labels דו-לשוניים - רק בטפסים */
.form-group label .text-ar,
.form-group label .text-he {
    margin: 0 4px;
}

/* Step labels */
.step-label .text-ar,
.step-label .text-he {
    display: block;
    font-size: 0.9em;
}

/* Cases count - רק מספר */
.cases-count {
    font-size: 18px;
    font-weight: 700;
}

.my-cases-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
}

.loading-content h2.text-ar {
    margin-bottom: 5px;
}

.loading-content h2.text-he {
    margin-bottom: 10px;
}

.loading-content p {
    font-size: 16px;
    opacity: 0.9;
}

.loading-content p.text-ar {
    margin-bottom: 5px;
}

.loading-content p.text-he {
    margin-bottom: 0;
}

/* === Error Screen === */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.error-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon i {
    font-size: 40px;
    color: var(--danger-color);
}

.error-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px;
    color: var(--text-primary);
}

.error-content h2.text-ar {
    margin-bottom: 5px;
}

.error-content h2.text-he {
    margin-bottom: 15px;
}

.error-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 30px;
    line-height: 1.6;
}

.error-content p.text-ar {
    margin-bottom: 5px;
}

.error-content p.text-he {
    margin-bottom: 30px;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* === 2FA Verification Screen === */
.verification-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #eef2ff 0%, #f1f5f9 50%, #faf5ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
}

.verification-content {
    text-align: center;
    max-width: 320px;
    width: 92%;
    padding: 24px 20px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin: auto;
}

.verification-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-icon i {
    font-size: 20px;
    color: white;
}

.verification-content h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-primary);
}

.verification-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 12px;
    line-height: 1.3;
}

.phone-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border-radius: 16px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    direction: ltr;
}

.phone-display i {
    font-size: 12px;
    color: #6366f1;
}

.customer-name-display {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 14px;
}

.customer-name-display #verificationCustomerName {
    font-weight: 600;
    color: #475569;
    margin-right: 3px;
}

.verification-form {
    margin-top: 0;
}

.code-input-container {
    margin-bottom: 12px;
}

.code-input-container label {
    display: none;
}

.code-input {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
    padding: 10px 12px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 6px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: block;
}

.code-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.code-input::placeholder {
    color: #cbd5e1;
    letter-spacing: 6px;
    font-size: 18px;
}

.code-hint {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 6px;
}

.verification-actions {
    margin-bottom: 12px;
}

.verification-actions .btn-primary {
    width: 100%;
    max-width: 160px;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
}

.verification-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.verification-footer {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.resend-text {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.btn-link {
    background: transparent;
    border: none;
    color: #6366f1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-link:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.08);
}

.btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-link-secondary {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.btn-link-secondary:hover {
    background: rgba(100, 116, 139, 0.08);
    color: #334155;
}

.dev-mode-notice {
    margin-top: 10px;
    padding: 6px 10px;
    background: #fef9c3;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    color: #854d0e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dev-mode-notice i {
    font-size: 10px;
}

/* Responsive for small screens */
@media (max-height: 600px) {
    .verification-content {
        padding: 20px 16px 16px;
    }
    
    .verification-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 10px;
        border-radius: 12px;
    }
    
    .verification-icon i {
        font-size: 18px;
    }
    
    .verification-content h2 {
        font-size: 15px;
    }
    
    .verification-subtitle {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .phone-display {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    .customer-name-display {
        font-size: 11px;
        margin-bottom: 12px;
    }
    
    .code-input {
        padding: 8px 10px;
        font-size: 20px;
        max-width: 140px;
    }
    
    .code-hint {
        display: none;
    }
    
    .verification-actions .btn-primary {
        padding: 8px 14px;
        font-size: 12px;
        max-width: 140px;
    }
    
    .verification-footer {
        padding-top: 10px;
    }
    
    .resend-text {
        font-size: 10px;
        margin-bottom: 2px;
    }
}

/* === Identification Screen === */
.identification-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

.identification-content {
    max-width: 360px;
    width: 92%;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.brand-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 28px 24px 24px;
    text-align: center;
}

.brand-header i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.brand-header h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
    opacity: 0.95;
}

.brand-header h1.text-ar {
    margin-bottom: 0;
}

.brand-header h1.text-he {
    margin-bottom: 10px;
}

.brand-header p {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
}

.brand-header p.text-ar {
    margin-bottom: 0;
}

.brand-header p.text-he {
    margin-bottom: 0;
}

.identification-form {
    padding: 24px;
}

.service-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

.service-option {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 12px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-option:hover {
    border-color: #c7d2fe;
    background: #fafafe;
}

.service-option.selected {
    background: #eef2ff;
    border-color: #6366f1;
}

.service-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.service-option.selected .service-icon {
    background: #6366f1;
    color: white;
}

.service-option h3 {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    color: #475569;
    line-height: 1.4;
}

.service-option.selected h3 {
    color: #4338ca;
}

.service-option h3.text-ar {
    margin-bottom: 1px;
}

.service-option h3.text-he {
    margin-bottom: 0;
}

.id-input-container {
    margin-top: 20px;
    animation: fadeUp 0.3s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.id-input-container label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #64748b;
}

.id-input-container label i {
    color: #6366f1;
    font-size: 14px;
}

.label-text-ar {
    font-family: 'Tajawal', 'Arial', sans-serif;
}

.label-text-he {
    font-family: 'Heebo', 'Segoe UI', sans-serif;
}

.label-text-ar::after {
    content: '/';
    margin: 0 4px;
    opacity: 0.4;
}

.id-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.2s ease;
    font-family: 'Heebo', sans-serif;
    margin-bottom: 16px;
    background: #f8fafc;
    text-align: center;
}

.id-input:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.id-input::placeholder {
    color: #94a3b8;
}

/* === Main Content === */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    animation: fadeIn 0.5s ease-out;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar-large {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.welcome-text h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--text-primary);
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.btn-new-case {
    position: relative;
    overflow: hidden;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-new-case:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* === Cases Section === */
.cases-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-header h2 .text-ar,
.section-header h2 .text-he {
    display: inline;
    margin: 0 5px;
}

.cases-count {
    background: var(--bg-gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.cases-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding: 5px;
    flex: 1;
    min-height: 0;
}

.cases-list::-webkit-scrollbar {
    width: 8px;
}

.cases-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.case-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.case-card::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Pro';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.3s;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.case-card:hover::after {
    opacity: 0.3;
    left: 15px;
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.case-id-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
}

.case-status-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-status-badge.open {
    background: #fef3c7;
    color: #d97706;
}

.case-status-badge.closed {
    background: #d1fae5;
    color: #059669;
}

.case-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.case-subject {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-gray);
    border-radius: 8px;
}

.subject-he {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.subject-ar {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Tajawal', sans-serif;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.case-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.case-meta i {
    color: var(--primary-color);
}

/* Document Cards */
.case-card.document-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    border-color: #fdba74;
}

.case-card.document-card:hover {
    border-color: #f97316;
}

.case-card.document-card.viewed {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #86efac;
}

.case-card.document-card.viewed:hover {
    border-color: #22c55e;
}

.case-id-badge.document-badge {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    color: #fff;
}

.case-card.document-card.viewed .case-id-badge.document-badge {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.case-status-badge.new {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fdba74;
}

.case-status-badge.viewed {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #86efac;
}

.empty-cases {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--bg-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: var(--text-secondary);
}

.empty-cases h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text-primary);
}

.empty-cases h3.text-ar {
    margin-bottom: 5px;
}

.empty-cases h3.text-he {
    margin-bottom: 10px;
}

.empty-cases p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.empty-cases p.text-ar {
    margin-bottom: 5px;
}

.empty-cases p.text-he {
    margin-bottom: 0;
}

/* === Modal Overlay === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.modal-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === Wizard === */
.wizard-header {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.wizard-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.step:first-child::after {
    display: none;
}

.step.completed::after {
    background: white;
}

.step-number {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    z-index: 1;
}

.step.active .step-number {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.step.completed .step-number {
    background: white;
    color: var(--success-color);
}

.step.completed .step-number::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Pro';
}

.step-label {
    font-size: 13px;
    opacity: 0.9;
}

.wizard-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.wizard-body::-webkit-scrollbar {
    width: 8px;
}

.wizard-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.wizard-step h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 25px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-step h3 i {
    color: var(--primary-color);
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.group-card {
    background: var(--bg-gray);
    border: 3px solid transparent;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.group-card.selected {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    border-color: var(--primary-color);
}

.group-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-color);
}

.group-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.3;
}

.group-card h4 .text-ar {
    font-size: 17px;
}

.group-card h4 .text-he {
    font-size: 16px;
    opacity: 0.85;
}

.group-check {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 24px;
    color: var(--success-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.group-card.selected .group-check {
    opacity: 1;
}

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.spinner-icon {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
    text-align: center;
}

.error-message i {
    font-size: 50px;
    color: var(--danger-color);
}

.error-message p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.no-subjects {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

.no-groups {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Accordion */
.accordion-item {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s;
}

.accordion-item.active {
    border-color: var(--primary-color);
}

.accordion-header {
    background: var(--bg-gray);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.accordion-header:hover {
    background: #f3f4f6;
}

.accordion-item.active .accordion-header {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
}

.category-title {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.title-he {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.title-ar {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Tajawal', sans-serif;
}

.accordion-icon {
    font-size: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.accordion-body {
    padding: 0;
}

.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.subject-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.subject-item:hover {
    background: var(--bg-gray);
}

.subject-item.selected {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.subject-icon {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
}

.subject-text {
    flex: 1;
}

.subject-name-he {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subject-name-ar {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Tajawal', sans-serif;
}

.subject-sla {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.subject-check {
    font-size: 24px;
    color: var(--success-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.subject-item.selected .subject-check {
    opacity: 1;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.form-group label i {
    color: var(--primary-color);
    flex-shrink: 0;
}

.form-group label .text-ar,
.form-group label .text-he {
    display: inline;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
    font-family: 'Heebo', sans-serif;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

/* File Upload */
.step-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0 0 25px;
}

.optional-notice {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 2px solid #60a5fa;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.optional-notice i {
    color: #2563eb;
    font-size: 20px;
    flex-shrink: 0;
}

.optional-notice span {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    color: #1e40af;
    font-weight: 500;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.file-upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-gray);
    position: relative;
}

.file-upload-area.compact {
    padding: 25px 20px;
}

.file-upload-area.compact .upload-icon {
    font-size: 30px;
    margin-bottom: 8px;
}

.file-upload-area.compact h4 {
    font-size: 14px;
    margin: 5px 0;
}

.file-upload-area.compact p {
    font-size: 12px;
    margin: 0;
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.upload-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-upload-area h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text-primary);
}

.file-upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-gray);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    position: relative;
}

.uploaded-file-item.uploaded {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.uploaded-file-item.just-uploaded {
    animation: highlightFile 2s ease;
}

@keyframes highlightFile {
    0% {
        background: #dcfce7;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        background: #bbf7d0;
        box-shadow: 0 0 15px 5px rgba(34, 197, 94, 0.2);
    }
    100% {
        background: #f0fdf4;
        box-shadow: none;
    }
}

.uploaded-file-item.error {
    border-color: var(--danger-color);
    background: #fef2f2;
}

.file-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.file-size {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
}

.remove-file-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-file-btn:hover {
    transform: scale(1.1);
}

/* Wizard Footer */
.wizard-footer {
    padding: 25px 40px;
    border-top: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: var(--bg-gray);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-large:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:disabled,
.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: scale(0.98);
}

.btn-primary,
.btn-success {
    transition: all 0.3s ease;
}

/* Success Modal */
.success-modal {
    max-width: 420px;
    text-align: center;
    padding: 30px 25px;
}

.success-icon-large {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--success-color);
    animation: successPulse 1.5s infinite;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.success-modal h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.success-modal h2.text-ar {
    margin-bottom: 3px;
}

.success-modal h2.text-he {
    margin-bottom: 12px;
}

.success-info {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: right;
}

.success-case-id {
    font-size: 16px;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.success-agent,
.success-time {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
}

.success-agent:last-child,
.success-time:last-child {
    margin-bottom: 0;
}

.success-agent i,
.success-time i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.success-agent div,
.success-time div {
    flex: 1;
    text-align: right;
}

.success-agent strong,
.success-time strong {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.success-agent span,
.success-time span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Alert Modal */
.alert-modal {
    max-width: 500px;
    padding: 30px;
}

.alert-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--warning-color);
}

.alert-modal h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.5;
}

.alert-modal h2 .text-ar {
    display: block;
    margin-bottom: 5px;
}

.alert-modal h2 .text-he {
    display: block;
    font-size: 0.95em;
}

.existing-case-info {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.existing-case-details p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.4;
}

.existing-case-details p:last-child {
    margin-bottom: 0;
}

.existing-case-details strong {
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
}

.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-actions button {
    padding: 12px 20px;
    font-size: 15px;
}

/* === Case Details Modal === */
.case-details-modal {
    max-width: 500px;
    margin: 16px;
    max-height: calc(100vh - 32px);
}

.modal-header-details {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 14px 16px;
    position: relative;
    flex-shrink: 0;
}

/* Top row: X button + ID badge + Status badge */
.modal-header-details .header-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header-details .modal-close {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-header-details .modal-close:hover {
    background: rgba(255,255,255,0.25);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Hide the h2 title completely - we only need ID and status */
.header-content h2 {
    display: none;
}

.header-content .case-id-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
}

.header-content .status-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    margin-right: auto;
}

.header-content .status-badge i {
    font-size: 10px;
}

.header-content .status-badge.open {
    background: #fef3c7;
    color: #b45309;
}

.header-content .status-badge.closed {
    background: #d1fae5;
    color: #047857;
}

.modal-body-details {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.details-section {
    margin-bottom: 12px;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
    overflow: hidden;
}

.details-section:hover {
    border-color: #c7d2fe;
}

.details-section:last-child {
    margin-bottom: 0;
}

.details-section > *:not(.section-title) {
    padding: 12px 14px;
}

/* Compact info section */
.compact-section .info-row-compact {
    padding: 12px 14px;
}

.info-row-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
}

.info-item-inline label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.info-item-inline label .text-ar,
.info-item-inline label .text-he {
    display: inline;
    margin: 0;
}

.info-item-inline label .text-ar::after {
    content: '/';
    margin: 0 2px;
}

.info-item-inline label::after {
    content: ':';
}

.info-item-inline > span {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

/* Unified content wrapper */
.case-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Title inside content - prominent */
.case-content-wrapper .case-title-display {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    padding: 0 0 10px 0;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    border-right: none;
}

/* Content body */
.case-content-wrapper .case-body-display {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 60px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}

/* Replies section - highlighted */
#repliesSection {
    background: #fff;
    border: 2px solid #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

#repliesSection .section-title {
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #6366f1;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.count-badge {
    background: #6366f1;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
}

.info-item label {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.info-item label::after {
    content: ':';
}

.info-item div {
    font-size: 12px;
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
}

.mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    margin-left: 4px;
}

.mini-avatar-icon {
    font-size: 18px;
    color: #94a3b8;
    vertical-align: middle;
    margin-left: 4px;
}

.text-secondary {
    color: var(--text-secondary);
    font-style: italic;
}

.case-title-display {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border-right: 4px solid var(--primary-color);
}

.case-body-display {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

/* עיצוב תוכן HTML מ-Quill */
.case-body-display p,
.reply-body p {
    margin: 0 0 10px;
}

.case-body-display p:last-child,
.reply-body p:last-child {
    margin-bottom: 0;
}

.case-body-display strong,
.reply-body strong {
    font-weight: 700;
}

.case-body-display em,
.reply-body em {
    font-style: italic;
}

.case-body-display ul,
.case-body-display ol,
.reply-body ul,
.reply-body ol {
    margin: 10px 0;
    padding-right: 20px;
}

.case-body-display li,
.reply-body li {
    margin-bottom: 5px;
}

.case-body-display a,
.reply-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.case-body-display a:hover,
.reply-body a:hover {
    color: var(--primary-hover);
}

.case-body-display blockquote,
.reply-body blockquote {
    border-right: 3px solid var(--primary-color);
    padding-right: 15px;
    margin: 15px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.case-body-display h1,
.case-body-display h2,
.case-body-display h3,
.reply-body h1,
.reply-body h2,
.reply-body h3 {
    margin: 15px 0 10px;
    font-weight: 700;
}

.case-body-display pre,
.reply-body pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Attachments List */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-gray);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.attachment-item:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateX(-5px);
}

.attachment-icon {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary-color);
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.attachment-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.attachment-download {
    font-size: 20px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.attachment-item:hover .attachment-download {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Replies */
.reply-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.reply-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateX(-3px);
}

.reply-card:last-child {
    margin-bottom: 0;
}

.reply-card.agent-reply {
    border-right: 5px solid var(--primary-color);
    background: linear-gradient(to left, rgba(99, 102, 241, 0.02) 0%, white 50%);
}

.reply-card.customer-reply {
    border-right: 5px solid var(--success-color);
    background: linear-gradient(to left, rgba(16, 185, 129, 0.03) 0%, white 50%);
}

.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reply-avatar,
.reply-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.reply-avatar-placeholder {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.reply-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.reply-status {
    padding: 6px 12px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-body {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reply-attachments {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
}

.reply-attachments-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    margin: 0 8px 8px 0;
    transition: all 0.3s;
}

.reply-attachment-item:hover {
    background: #eff6ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.reply-attachment-item i {
    font-size: 16px;
}

.no-replies {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-replies i {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-replies p {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-type-selector {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .page-header {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
        gap: 12px;
    }
    
    .cases-section {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .section-header h2 .text-ar,
    .section-header h2 .text-he {
        display: block;
        font-size: 0.9em;
    }
    
    .section-header h2 .text-ar {
        margin-bottom: 3px;
    }
    
    .welcome-section {
        flex-direction: row;
        gap: 12px;
    }
    
    .user-avatar-large {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .welcome-text h1 {
        font-size: 18px;
    }
    
    .welcome-text p {
        font-size: 13px;
    }
    
    .btn-new-case {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        font-size: 15px;
    }
    
    .btn-text-container {
        gap: 0;
    }
    
    .btn-text-container .text-ar,
    .btn-text-container .text-he {
        font-size: 0.9em;
    }
    
    .wizard-steps {
        flex-wrap: wrap;
    }
    
    .step::after {
        display: none;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .groups-grid {
        grid-template-columns: 1fr;
    }
    
    .wizard-footer {
        flex-direction: column-reverse;
    }
    
    .wizard-footer button {
        width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body-details {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-header-details {
        padding: 12px 14px;
    }
    
    .modal-header-details .modal-close {
        width: 28px;
        height: 28px;
    }
    
    .header-content .case-id-badge {
        font-size: 14px;
        padding: 4px 12px;
    }
    
    .header-content .status-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .header-content .case-id-badge {
        font-size: 14px;
    }
    
    .info-row-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 8px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .modal-container {
        border-radius: 16px;
        max-height: calc(100vh - 80px);
    }
    
    .case-details-modal {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-header-details {
        padding: 10px 12px;
    }
    
    .modal-header-details .modal-close {
        width: 26px;
        height: 26px;
    }
    
    .header-content .case-id-badge {
        font-size: 13px;
        padding: 3px 10px;
    }
    
    .header-content .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .details-section > *:not(.section-title) {
        padding: 10px 12px;
    }
    
    .modal-body-details {
        padding: 12px;
    }
    
    .details-section {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .info-item-inline {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .info-item-inline label {
        font-size: 10px;
    }
    
    .info-item-inline > span {
        font-size: 12px;
    }
    
    .wizard-body {
        padding: 25px;
    }
    
    .wizard-footer {
        padding: 20px 25px;
    }
    
    .alert-modal {
        padding: 25px 20px;
    }
    
    .alert-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .alert-modal h2 {
        font-size: 16px;
    }
    
    .existing-case-details p {
        font-size: 13px;
    }
    
    /* Compact identification screen for mobile */
    .identification-screen {
        padding: 16px;
        align-items: center;
    }
    
    .identification-content {
        max-width: 100%;
        border-radius: 20px;
    }
    
    .brand-header {
        padding: 24px 20px 20px;
    }
    
    .brand-header i {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .brand-header h1 {
        font-size: 14px;
    }
    
    .brand-header p {
        font-size: 11px;
    }
    
    /* Compact 2FA screen for mobile */
    .verification-content {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .verification-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        margin-bottom: 14px;
    }
    
    .verification-icon i {
        font-size: 22px;
    }
    
    .verification-content h2 {
        font-size: 16px;
    }
    
    .phone-display {
        padding: 6px 14px;
        font-size: 14px;
    }
    
    .code-input {
        max-width: 160px;
        padding: 10px 12px;
        font-size: 22px;
        letter-spacing: 6px;
    }
    
    .verification-actions .btn-primary {
        max-width: 160px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .verification-footer {
        padding-top: 12px;
    }
    
    .identification-form {
        padding: 20px;
    }
    
    .service-type-selector {
        gap: 10px;
    }
    
    .service-option {
        padding: 16px 10px 12px;
        border-radius: 14px;
    }
    
    .service-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        margin-bottom: 8px;
        border-radius: 12px;
    }
    
    .service-option h3 {
        font-size: 11px;
    }
    
    .id-input-container {
        margin-top: 16px;
    }
    
    .id-input-container label {
        font-size: 12px;
    }
    
    .id-input {
        padding: 12px 14px;
        font-size: 15px;
        margin-bottom: 14px;
        border-radius: 12px;
    }
    
    .btn-large {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print */
@media print {
    .loading-screen,
    .error-screen,
    .identification-screen,
    .modal-overlay {
        display: none !important;
    }
}

/* ========== Custom Forms Integration ========== */

/* Badge for subjects with custom forms */
.custom-form-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.subject-item {
    position: relative;
}

/* Custom Form Container */
.custom-form-container {
    padding: 0;
}

.custom-form-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--theme-color, var(--primary-color));
    margin-bottom: 8px;
    text-align: center;
}

.custom-form-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 25px;
}

.custom-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.custom-form-field {
    flex: 1 1 100%;
}

.custom-form-field[style*="50%"] {
    flex: 1 1 calc(50% - 10px);
}

.custom-form-field label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.custom-form-field .required-mark {
    color: var(--danger-color);
    margin-right: 4px;
}

.form-section-header {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--theme-color, var(--primary-color));
    border-bottom: 2px solid var(--theme-color, var(--primary-color));
    padding-bottom: 8px;
    margin: 15px 0 20px;
}

.form-section-text {
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 10px 0;
}

.form-input,
.form-textarea,
.form-select,
.form-file-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--theme-color, var(--primary-color));
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.is-invalid,
.form-textarea.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Checkbox & Radio */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--theme-color, var(--primary-color));
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.radio-group-label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Signature Pad */
.signature-container {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 15px;
    background: #fafafa;
    position: relative;
}

.signature-pad {
    display: block;
    width: 100%;
    max-width: 400px;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.btn-clear-signature {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-clear-signature:hover {
    background: var(--bg-gray);
    border-color: var(--text-secondary);
}

/* File Input */
.form-file-input {
    cursor: pointer;
}

.form-file-input::file-selector-button {
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.form-file-input::file-selector-button:hover {
    background: var(--primary-hover);
}

/* Mobile Adjustments for Custom Forms */
@media (max-width: 768px) {
    .custom-form-fields {
        gap: 15px;
    }
    
    .custom-form-field,
    .custom-form-field[style*="50%"] {
        flex: 1 1 100%;
    }
    
    .signature-pad {
        max-width: 100%;
    }
}
