/**
 * MadBot - Modal Styles
 * Overlay, content, headers, footers
 */

/* ==========================================================================
   MODAL OVERLAY
   ========================================================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal, 1000);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active,
.modal-overlay.show {
    display: flex;
}

/* ==========================================================================
   MODAL CONTENT
   ========================================================================== */

.modal-content {
    background: var(--dark, #0F0F14);
    border-radius: var(--border-radius-lg, 16px);
    padding: 28px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.2s ease;
}

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

/* Modal sizes */
.modal-content.modal-sm {
    max-width: 320px;
}

.modal-content.modal-lg {
    max-width: 600px;
}

.modal-content.modal-xl {
    max-width: 800px;
}

/* ==========================================================================
   MODAL HEADER
   ========================================================================== */

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    margin-bottom: 20px;
}

.modal-header .modal-title {
    margin-bottom: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   MODAL CLOSE BUTTON
   ========================================================================== */

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: var(--light);
}

/* ==========================================================================
   MODAL BODY
   ========================================================================== */

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ==========================================================================
   MODAL FOOTER / ACTIONS
   ========================================================================== */

.modal-footer,
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-actions.stack {
    flex-direction: column;
}

.modal-actions .btn {
    flex: 1;
}

/* Cancel button style */
.btn-cancel {
    padding: 12px 24px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    color: var(--light);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.btn-cancel:hover {
    background: rgba(255,255,255,0.15);
}

/* ==========================================================================
   PREMIUM MODAL (Special styling)
   ========================================================================== */

.premium-modal .modal-content {
    text-align: center;
    max-width: 400px;
}

.premium-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.premium-features {
    text-align: left;
    margin: 24px 0;
}

.premium-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.premium-feature:last-child {
    border-bottom: none;
}

.premium-feature .icon {
    color: var(--primary);
}

/* ==========================================================================
   CONFIRM MODAL
   ========================================================================== */

.confirm-modal .modal-content {
    max-width: 380px;
}

.confirm-modal .modal-body {
    text-align: center;
}

.confirm-modal .modal-actions {
    justify-content: center;
}

/* ==========================================================================
   LIGHT MODE
   ========================================================================== */

.light-mode .modal-content {
    background: #FFFFFF;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.light-mode .modal-close {
    background: rgba(0,0,0,0.05);
    color: #64748B;
}

.light-mode .modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #1E293B;
}

.light-mode .btn-cancel {
    background: #F1F5F9;
    color: #1E293B;
}

.light-mode .btn-cancel:hover {
    background: #E2E8F0;
}

.light-mode .premium-feature {
    border-color: #E2E8F0;
}

/* ==========================================================================
   MODAL FORM ELEMENTS (select, textarea)
   ========================================================================== */

/* Select dropdown in modals */
.modal select,
.modal-content select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: var(--bg-secondary, #1a1a24);
    color: var(--text, #FAFAFA);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    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='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modal select:focus,
.modal-content select:focus {
    outline: none;
    border-color: var(--primary, #6366F1);
}

/* Select options - Dark mode */
.modal select option,
.modal-content select option {
    background: #1a1a24;
    color: #FAFAFA;
    padding: 10px;
}

/* Light mode - Select */
.light-mode .modal select,
.light-mode .modal-content select {
    background: #FFFFFF;
    color: #1E293B;
    border-color: #E2E8F0;
    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='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.light-mode .modal select option,
.light-mode .modal-content select option {
    background: #FFFFFF;
    color: #1E293B;
}
