/* ============================================
   Modal & Logger Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.modal-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 92vh;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.open .modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 2px;
    margin: 10px auto 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-close {
    background: var(--bg-elevated);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-save {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
}

.modal-save:disabled {
    opacity: 0.4;
}

.modal-body {
    padding: 20px;
    padding-bottom: 40px;
}

/* ---- Mode Toggle ---- */
.mode-toggle {
    display: flex;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* ---- Timer Display ---- */
.timer-section {
    text-align: center;
    margin-bottom: 24px;
}

.timer-display {
    font-size: 56px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.timer-display.running {
    color: var(--accent-blue);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.timer-btn {
    padding: 12px 32px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.timer-start {
    background: var(--accent-green);
    color: white;
}

.timer-stop {
    background: var(--accent-red);
    color: white;
}

/* ---- Picker Styles ---- */
.picker-group {
    margin-bottom: 16px;
}

.picker-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.picker-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238E8E93' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
    outline: none;
}

.picker-select:focus {
    border-color: var(--accent-blue);
}

.picker-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.picker-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.picker-input:focus {
    border-color: var(--accent-blue);
}

.picker-input::placeholder {
    color: var(--text-tertiary);
}

.picker-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 60px;
}

.picker-textarea:focus {
    border-color: var(--accent-blue);
}

.picker-row {
    display: flex;
    gap: 12px;
}

.picker-half {
    flex: 1;
}

/* ---- Chazara Toggle ---- */
.chazara-toggle {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-elevated);
    border-radius: 12px;
    transition: 0.3s;
    cursor: pointer;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

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

/* ---- Session List on Dashboard ---- */
.session-item {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.session-icon.gemara { background: rgba(74, 144, 217, 0.15); }
.session-icon.mishna { background: rgba(52, 199, 89, 0.15); }
.session-icon.halacha { background: rgba(201, 169, 97, 0.15); }
.session-icon.chumash { background: rgba(255, 69, 58, 0.15); }
.session-icon.other { background: rgba(142, 142, 147, 0.15); }

.session-info {
    flex: 1;
    min-width: 0;
}

.session-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-duration {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.session-chazara-badge {
    font-size: 10px;
    background: rgba(201, 169, 97, 0.2);
    color: var(--accent-gold);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
}
