/* VERSION: 2.0.0 */
/* css/modals-core.css */
/* Base styles for generic modals (Stream, Captions, Video, Keybinds) */
/* Unified to match the premium styling of the Info/Readme modal */

.modal-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(4, 6, 10, 0.82); 
    z-index: 90; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.25s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.modal-overlay.visible { 
    opacity: 1; 
    pointer-events: auto; 
}

/* Unified Card Style */
.modal-content, .readme-card {
    background: var(--bg-surface-elevated, rgba(16, 20, 32, 0.94));
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
    border-radius: 16px;
    box-shadow: var(--glass-shadow-deep), var(--glass-rim-top);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    animation: modalSlideIn 0.25s ease-out;
}

/* Gradient Top Border Effect */
.modal-content::before, .readme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.modal-header, .readme-header {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.modal-header h3, .readme-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-main, #ffffff);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .modal-close-btn,
.modal-header .icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .modal-close-btn:hover,
.modal-header .icon-btn:hover {
    color: var(--text-main, #ffffff);
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
}

/* Content Body */
.modal-body, .readme-content {
    padding: 24px;
    overflow-y: auto;
    color: var(--text-muted, rgba(240, 246, 252, 0.82));
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Input Fields */
.modal-body input[type="text"] { 
    background: var(--bg-well-recessed, rgba(4, 6, 10, 0.75)); 
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12)); 
    color: var(--text-main, #ffffff); 
    padding: 11px 14px; 
    border-radius: 8px; 
    width: 100%;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-body input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(6, 9, 15, 0.9);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 255, 255, 0.15);
}

/* Setting Rows */
.setting-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 15px; 
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label { 
    color: #ccc; 
    font-size: 0.9rem; 
    min-width: 100px;
}

.setting-row input[type="range"] { 
    flex: 1; 
    cursor: pointer;
}

.setting-row input[type="color"] { 
    border: none; 
    width: 36px; 
    height: 36px; 
    padding: 0; 
    background: none; 
    cursor: pointer; 
    border-radius: 4px;
    overflow: hidden;
}

/* Footer / Actions */
.modal-actions { 
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    display: flex; 
    justify-content: flex-end; 
    gap: 12px; 
    position: relative;
    z-index: 1;
}

.modal-actions button { 
    background: rgba(255, 255, 255, 0.08); 
    color: var(--text-main, #ffffff); 
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14)); 
    padding: 9px 18px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: all 0.18s ease;
}

.modal-actions button:hover { 
    background: rgba(255, 255, 255, 0.18); 
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Custom Scrollbar */
.modal-body::-webkit-scrollbar, .readme-content::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track, .readme-content::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb, .readme-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb:hover, .readme-content::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }