/* 
  StudyNator v2.0 — UI Components, Stacked Modals, Snackbars, Offline Banner & OLED Pocket Lock (ui.css)
  Included in sw.js v6 ASSETS for 100% Offline PWA execution (#5)
*/

/* Stacked Modal Overlay (Prevents Top Clipping on Mobile & Desktop) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 0.85rem;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.show {
    opacity: 1;
}

.modal-card {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    margin: auto 0;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-lg);
}

.modal-card.modal-card-wide {
    max-width: 720px;
}

.modal-overlay.show .modal-card {
    transform: scale(1) translateY(0);
}

.modal-card h2 {
    font-size: 1.18rem;
}

.modal-content {
    margin-bottom: 1.15rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

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

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Form Controls */
.form-group {
    margin-bottom: 0.95rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Snackbar Container */
.snackbar-container {
    position: fixed;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2500;
    pointer-events: none;
    width: min(440px, calc(100vw - 24px));
}

.snackbar {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 0.78rem 1.2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    text-align: center;
}

.snackbar.snackbar-success { border-left-color: var(--secondary); }
.snackbar.snackbar-error { border-left-color: var(--danger); }

.snackbar.show {
    transform: translateY(0);
    opacity: 1;
}

/* Offline Network Guard Banner */
.offline-guard-banner {
    background: #F59E0B;
    color: #111827;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    padding: 0.45rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 1500;
}

/* #000000 Pure OLED Pocket Lock Overlay (#22) */
.oled-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: #000000 !important;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.oled-lock-inner {
    max-width: 400px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.oled-status-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #1F2937;
    color: #9CA3AF;
}

.oled-card-counter {
    font-size: 1.15rem;
    font-weight: 800;
    color: #D1D5DB;
}

.oled-card-preview {
    font-size: 0.92rem;
    color: #6B7280;
    max-width: 340px;
    line-height: 1.45;
}

.oled-timer-info {
    font-size: 0.78rem;
    color: #4B5563;
}

.oled-unlock-btn {
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    padding: 1rem 1.75rem;
    border-radius: 999px;
    border: 1px solid #1F2937;
    background: #050505;
    color: #9CA3AF;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.oled-hold-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0%;
    background: #6366F1;
}
