/* ============================================
   WHITE GLASS DESIGN SYSTEM
   Premium cream/white modal and component styling
   Extracted from components.css
   ============================================ */

/* ============================================
   THEME-BASED UTILITY CLASSES
   Replace hardcoded Tailwind colors with these
   ============================================ */

/* Surface backgrounds - Use instead of bg-[#141820] */
.bg-surface-dark {
    background-color: var(--bg-elevated) !important;
}

.bg-surface-glass {
    background: rgba(var(--bg-elevated-rgb), 0.8) !important;
    backdrop-filter: blur(12px);
}

/* For inputs and controls */
.bg-input-dark {
    background-color: var(--bg-input) !important;
}

/* Light theme overrides */
[data-theme="light"] .bg-surface-dark {
    background-color: var(--bg-surface) !important;
}

[data-theme="light"] .bg-surface-glass {
    background: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .bg-input-dark {
    background-color: #ffffff !important;
}

/* ============================================
   WHITE GLASS MODAL BASE
   ============================================ */

.modal-white-glass {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.5rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    color: #1e293b;
    overflow: hidden;
}

/* White Glass Modal Header */
.modal-white-glass .modal-header,
.modal-white-glass-header {
    background: linear-gradient(to right, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-white-glass .modal-title,
.modal-white-glass-title {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.125rem;
}

.modal-white-glass .modal-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* White Glass Modal Body */
.modal-white-glass .modal-body,
.modal-white-glass-body {
    background: #ffffff;
    color: #334155;
    padding: 1.5rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* White Glass Modal Footer */
.modal-white-glass .modal-footer,
.modal-white-glass-footer {
    background: rgba(248, 250, 252, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   WHITE GLASS FORM INPUTS
   ============================================ */

.modal-white-glass input[type="text"],
.modal-white-glass input[type="url"],
.modal-white-glass input[type="number"],
.modal-white-glass input[type="email"],
.modal-white-glass input[type="password"],
.modal-white-glass input[type="datetime-local"],
.modal-white-glass textarea,
.modal-white-glass select,
.wg-input {
    width: 100%;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #1e293b;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-white-glass input:focus,
.modal-white-glass textarea:focus,
.modal-white-glass select:focus,
.wg-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.modal-white-glass input::placeholder,
.modal-white-glass textarea::placeholder,
.wg-input::placeholder {
    color: #94a3b8;
}

/* White Glass Select Dropdown */
.modal-white-glass select,
.wg-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.modal-white-glass select option {
    background: #ffffff;
    color: #1e293b;
}

/* White Glass Labels */
.modal-white-glass label,
.wg-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   WHITE GLASS TOGGLE SWITCH
   ============================================ */

.wg-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.wg-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.wg-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: 0.3s;
    border: 2px solid #e2e8f0;
}

.wg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.wg-toggle input:checked+.wg-toggle-slider {
    background: #10b981;
    border-color: #059669;
}

.wg-toggle input:checked+.wg-toggle-slider:before {
    transform: translateX(22px);
}

/* ============================================
   WHITE GLASS CARDS
   ============================================ */

.wg-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #1e293b;
}

.wg-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wg-card.active {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.wg-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.wg-card-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.wg-card-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.wg-card-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.wg-card-icon.amber {
    background: #fef3c7;
    color: #d97706;
}

.wg-card-icon.red {
    background: #fee2e2;
    color: #dc2626;
}

.wg-card-icon.pink {
    background: #fce7f3;
    color: #db2777;
}

/* White Glass Action Cards (Dashed Border) */
.wg-action-card {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.wg-action-card:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #7c3aed;
}

.wg-action-card.active {
    border-style: solid;
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

/* ============================================
   WHITE GLASS BUTTONS
   ============================================ */

.wg-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wg-btn-primary {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.wg-btn-primary:hover {
    background: linear-gradient(135deg, #059669, #0d9488);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.wg-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.wg-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.wg-btn-ghost {
    background: transparent;
    color: #64748b;
}

.wg-btn-ghost:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* White Glass Close Button */
.wg-close {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0.75rem;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wg-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.wg-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================
   WHITE GLASS CHIPS/TAGS
   ============================================ */

.wg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.wg-chip.green {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.wg-chip.pink {
    background: #fdf2f8;
    color: #db2777;
    border-color: #fbcfe8;
}

.wg-chip.blue {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.wg-chip.purple {
    background: #f5f3ff;
    color: #7c3aed;
    border-color: #c4b5fd;
}

.wg-chip.amber {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

/* ============================================
   WHITE GLASS PROGRESS BARS
   ============================================ */

.wg-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.wg-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.wg-progress-fill.purple {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.wg-progress-fill.pink {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}

.wg-progress-fill.green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.wg-progress-fill.blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.wg-progress-fill.orange {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ============================================
   WHITE GLASS ALERTS
   ============================================ */

.wg-alert {
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.wg-alert.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.wg-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.wg-alert.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.wg-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ============================================
   WHITE GLASS SECTION DIVIDER
   ============================================ */

.wg-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1.5rem 0;
}

/* ============================================
   WHITE GLASS TEXT UTILITIES
   ============================================ */

.wg-text-primary {
    color: #0f172a;
}

.wg-text-secondary {
    color: #475569;
}

.wg-text-muted {
    color: #94a3b8;
}

.wg-text-success {
    color: #16a34a;
}

.wg-text-warning {
    color: #d97706;
}

.wg-text-error {
    color: #dc2626;
}

/* ============================================
   WHITE GLASS SCROLLBAR
   ============================================ */

.modal-white-glass ::-webkit-scrollbar {
    width: 6px;
}

.modal-white-glass ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.modal-white-glass ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-white-glass ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   WHITE GLASS MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .white-glass-theme {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        border-radius: 1rem 1rem 0 0 !important;
        max-height: 95vh !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    .modal-white-glass-body {
        padding: 1rem !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
    }

    .modal-white-glass-header {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }

    .modal-white-glass-header h3 {
        font-size: 1.125rem !important;
    }

    .modal-white-glass-header img,
    .modal-white-glass-header>div:first-child {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    .modal-white-glass-footer {
        padding: 1rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-white-glass-footer button {
        flex: 1;
        min-width: 100px;
        padding: 0.75rem 1rem !important;
    }

    .wg-chip {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.65rem !important;
    }
}