/**
 * نظام النوافذ المنبثقة المحسن - نادي أدِيب
 * متوافق مع هوية النادي وتصميمات الأزرار والحقول
 */

:root {
    /* ألوان نادي أدِيب */
    --main-blue: #274060;
    --accent-blue: #3d8fd6;
    --light-blue: #6ba8e2;
    --dark-blue: #1a2a3a;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --purple-color: #8b5cf6;
    
    /* تأثيرات متوافقة مع التصميمات الأخرى */
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-blue: 0 4px 20px rgba(61, 143, 214, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ============================================================================
   الخلفية المعتمة (Backdrop)
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(39, 64, 96, 0.85), rgba(26, 42, 58, 0.9));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                visibility 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   النافذة المنبثقة الأساسية (تصميم جديد كلياً)
   ============================================================================ */

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(61, 143, 214, 0.1);
    z-index: 9999;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(61, 143, 214, 0.2);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================================================
   محتوى النافذة المنبثقة (wrapper)
   ============================================================================ */

.modal-content {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* زر الأيقونة في النوافذ المنبثقة */
.modal .btn-icon {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--main-blue);
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.modal .btn-icon:hover {
    background: rgba(61, 143, 214, 0.1);
    color: var(--accent-blue);
}

.modal .btn-icon:active {
    transform: scale(0.95);
}

/* ============================================================================
   أحجام النوافذ المنبثقة
   ============================================================================ */

.modal-sm {
    width: 420px;
}

.modal-md {
    width: 640px;
}

.modal-lg {
    width: 880px;
}

.modal-xl {
    width: 1100px;
}

.modal-fullscreen {
    width: 96vw;
    height: 96vh;
    transform: translate(-50%, -50%) scale(0.95);
    border-radius: var(--radius-lg);
}

.modal-fullscreen.active {
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================================================
   رأس النافذة المنبثقة (تصميم جديد مع زر X)
   ============================================================================ */

.modal-header {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid rgba(61, 143, 214, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.08), rgba(107, 168, 226, 0.04));
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--main-blue));
}

.modal-header-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-blue);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    letter-spacing: -0.01em;
}

.modal-header i {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.15), rgba(61, 143, 214, 0.08));
    border-radius: 12px;
    color: var(--accent-blue);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* زر الإغلاق X - تصميم متميز */
.modal-close-x {
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--main-blue);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    font-size: 1.25rem;
}

.modal-close-x::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.1), rgba(61, 143, 214, 0.05));
    border-radius: inherit;
    transition: all 0.3s ease;
    z-index: 0;
}

.modal-close-x i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.modal-close-x:hover {
    color: var(--accent-blue);
}

.modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.2), rgba(61, 143, 214, 0.1));
    transform: scale(1.1);
}

.modal-close-x:hover i {
    transform: rotate(90deg);
}

.modal-close-x:active {
    transform: scale(0.95);
}

/* ============================================================================
   محتوى النافذة المنبثقة (محسّن)
   ============================================================================ */

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: linear-gradient(180deg, #ffffff, #fafcff);
}

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(61, 143, 214, 0.05);
    border-radius: 10px;
    margin: 8px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--light-blue), var(--accent-blue));
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-blue), var(--main-blue));
    border: 2px solid transparent;
    background-clip: content-box;
}

/* ============================================================================
   تذييل النافذة المنبثقة (محسّن)
   ============================================================================ */

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(61, 143, 214, 0.15);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.04), rgba(61, 143, 214, 0.02));
}

/* تنسيق أزرار النوافذ المنبثقة */
.modal-footer .btn--outline-secondary {
    color: #64748b !important;
    border-color: #64748b !important;
    background: transparent !important;
}

.modal-footer .btn--outline-secondary:hover {
    background: linear-gradient(to right, #64748b, #475569) !important;
    color: white !important;
}

/* ============================================================================
   أنواع النوافذ المنبثقة (ألوان متنوعة)
   ============================================================================ */

.modal-success .modal-header::before {
    background: linear-gradient(90deg, var(--success-color), #059669);
}

.modal-success .modal-header i {
    color: var(--success-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
}

.modal-success .modal-close-x:hover {
    color: var(--success-color);
}

.modal-success .modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
}

.modal-warning .modal-header::before {
    background: linear-gradient(90deg, var(--warning-color), #d97706);
}

.modal-warning .modal-header i {
    color: var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08));
}

.modal-warning .modal-close-x:hover {
    color: var(--warning-color);
}

.modal-warning .modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
}

.modal-danger .modal-header::before {
    background: linear-gradient(90deg, var(--error-color), #dc2626);
}

.modal-danger .modal-header i {
    color: var(--error-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
}

.modal-danger .modal-close-x:hover {
    color: var(--error-color);
}

.modal-danger .modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
}

.modal-info .modal-header::before {
    background: linear-gradient(90deg, var(--info-color), #2563eb);
}

.modal-info .modal-header i {
    color: var(--info-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
}

.modal-info .modal-close-x:hover {
    color: var(--info-color);
}

.modal-info .modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
}

.modal-purple .modal-header::before {
    background: linear-gradient(90deg, var(--purple-color), #9333ea);
}

.modal-purple .modal-header i {
    color: var(--purple-color);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
}

.modal-purple .modal-close-x:hover {
    color: var(--purple-color);
}

.modal-purple .modal-close-x:hover::before {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
}

/* ============================================================================
   نافذة التأكيد (محسّنة)
   ============================================================================ */

.modal-confirm {
    width: 480px;
    text-align: center;
}

.modal-confirm .modal-body {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.modal-confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: pulseIcon 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

.modal-confirm-icon.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.modal-confirm-icon.warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.modal-confirm-icon.danger {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    color: white;
}

.modal-confirm-icon.info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    color: white;
}

.modal-confirm-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 360px;
}

.modal-confirm-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-blue);
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.modal-confirm-message {
    color: #335c81;
    line-height: 1.6;
    font-size: 1.05rem;
    margin: 0;
}

/* ============================================================================
   نافذة النموذج (متوافقة مع form-inputs.css)
   ============================================================================ */

.modal-form .modal-body {
    padding: 2rem;
}

.modal-form .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.modal-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--main-blue);
    font-size: 0.95rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.modal-form label .required {
    color: var(--error-color);
    margin-right: 0.25rem;
    font-weight: 700;
}

.modal-form .form-input,
.modal-form .form-select,
.modal-form .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(61, 143, 214, 0.25);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 255, 0.98));
    color: var(--main-blue);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    box-shadow: 0 2px 10px rgba(39, 64, 96, 0.06);
    font-family: inherit;
}

.modal-form .form-input:focus,
.modal-form .form-select:focus,
.modal-form .form-textarea:focus {
    border-color: rgba(61, 143, 214, 0.35);
    box-shadow: 0 0 0 4px rgba(61, 143, 214, 0.18), 0 2px 10px rgba(39, 64, 96, 0.06);
    background: #ffffff;
}

.modal-form .form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.modal-form .form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-family: inherit;
}

.modal-form .form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #92400e;
    font-weight: 500;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ============================================================================
   نافذة المشاركة (محسّنة)
   ============================================================================ */

.modal-share .modal-body {
    padding: 2rem;
}

.share-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border: 2px solid rgba(61, 143, 214, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    text-decoration: none;
}

.share-option:hover {
    border-color: var(--accent-blue);
    background: linear-gradient(180deg, #f0f9ff, #e6f4ff);
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
}

.share-option i {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: white;
}

.share-option.whatsapp i {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.share-option.twitter i {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.share-option.facebook i {
    background: linear-gradient(135deg, #1877f2, #0e5fc7);
}

.share-option.instagram i {
    background: linear-gradient(45deg, #e1306c, #c13584, #833ab4);
}

.share-option.email i {
    background: linear-gradient(135deg, #ea4335, #d93025);
}

.share-option.link i {
    background: linear-gradient(135deg, var(--accent-blue), var(--main-blue));
}

.share-option span {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--main-blue);
    text-align: center;
}

.share-link-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.08), rgba(61, 143, 214, 0.04));
    border: 1px solid rgba(61, 143, 214, 0.2);
    border-radius: var(--radius-md);
}

.share-link-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    color: var(--main-blue);
    font-family: inherit;
    padding: 0.5rem;
}

.share-link-copy {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--main-blue));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.share-link-copy:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
}

.share-link-copy.copied {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

/* ============================================================================
   نافذة الإشعارات/التنبيهات
   ============================================================================ */

.modal-alert {
    width: 400px;
}

.modal-alert .modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.modal-alert-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.modal-alert-success .modal-alert-icon {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.modal-alert-warning .modal-alert-icon {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.modal-alert-error .modal-alert-icon {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
}

/* ============================================================================
   تأثيرات الحركة المحسنة (من المنتصف)
   ============================================================================ */

@keyframes modalZoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes modalZoomOut {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

.modal.active {
    animation: modalZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal.closing {
    animation: modalZoomOut 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================================================
   التوافق مع الشاشات الصغيرة
   ============================================================================ */

@media (max-width: 768px) {
    .modal {
        width: 95vw !important;
        max-height: 85vh;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-header h2,
    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-header i {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .modal-close-x {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1.25rem 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }

    .modal-confirm {
        width: 90vw !important;
    }
    
    .modal-confirm .modal-body {
        padding: 2rem 1.5rem;
    }
    
    .modal-confirm-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .share-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .share-option {
        padding: 1.25rem 0.75rem;
    }
    
    .share-option i {
        width: 48px;
        height: 48px;
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .modal {
        border-radius: var(--radius-lg);
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        min-width: 100%;
    }
    
    .share-options-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   منع التمرير عند فتح النافذة المنبثقة
   ============================================================================ */

body.modal-open {
    overflow: hidden;
    padding-right: 15px; /* لمنع القفزة عند ظهور شريط التمرير */
}

/* ============================================================================
   وضع الدارك (اختياري)
   ============================================================================ */

/* ============================================================================
   Custom Modal - النوافذ المنبثقة المخصصة
   ============================================================================ */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.custom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.custom-modal-container {
    position: relative;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    width: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.custom-modal.active .custom-modal-container {
    transform: scale(1);
}

.custom-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(61, 143, 214, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(61, 143, 214, 0.08), rgba(107, 168, 226, 0.04));
}

.custom-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--main-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-modal-close {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--main-blue);
    transition: all 0.2s ease;
}

.custom-modal-close:hover {
    background: rgba(61, 143, 214, 0.1);
    color: var(--accent-blue);
}

.custom-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.custom-modal-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(61, 143, 214, 0.15);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .modal {
        background: linear-gradient(135deg, #1e293b, #0f172a);
        border-color: rgba(61, 143, 214, 0.3);
    }
    
    .modal-header {
        background: linear-gradient(135deg, rgba(61, 143, 214, 0.15), rgba(61, 143, 214, 0.08));
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .modal-header h2,
    .modal-header h3 {
        color: #e2e8f0;
    }
    
    .modal-body {
        background: linear-gradient(180deg, #1e293b, #0f172a);
    }
    
    .modal-close-x {
        color: #e2e8f0;
    }
    
    .modal-close-x::before {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    }
    
    .modal-close-x:hover::before {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    }
    
    .modal-form .form-input,
    .modal-form .form-select,
    .modal-form .form-textarea {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        color: #e2e8f0;
    }
    
    .modal-form .form-input:focus,
    .modal-form .form-select:focus,
    .modal-form .form-textarea:focus {
        background: rgba(255, 255, 255, 0.08);
    }
    
    .share-option {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .share-option:hover {
        background: rgba(61, 143, 214, 0.15);
    }
}