/**
 * Mode Selector Modal Styles
 * Unified practice mode selector with 3 options
 */

/* Modal Overlay */
.mode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.mode-modal-content {
    position: relative;
    background: var(--card-bg, #fff);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modeModalSlideIn 0.3s ease;
}

@keyframes modeModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.mode-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    background: linear-gradient(135deg,
            hsla(var(--primary-hue, 150), 50%, 95%, 1),
            hsla(var(--primary-hue, 150), 40%, 98%, 1));
}

.mode-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color, #333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-modal-header h3 i {
    color: var(--primary-color, #4eba8a);
}

.mode-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--muted-text, #666);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.mode-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-color, #333);
}

/* Modal Body */
.mode-modal-body {
    padding: 20px;
}

/* Mode Cards Container */
.mode-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* Individual Mode Card */
.mode-card {
    flex: 1;
    padding: 16px 12px;
    background: var(--card-bg, #f8f9fa);
    border: 2px solid transparent;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    outline: none;
}

.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color, #4eba8a);
}

.mode-card:focus {
    box-shadow: 0 0 0 3px hsla(var(--primary-hue, 150), 50%, 50%, 0.3);
}

.mode-card[aria-checked="true"] {
    background: linear-gradient(135deg,
            hsla(var(--primary-hue, 150), 50%, 95%, 1),
            hsla(var(--primary-hue, 150), 45%, 92%, 1));
    border-color: var(--primary-color, #4eba8a);
    box-shadow: 0 4px 15px hsla(var(--primary-hue, 150), 50%, 50%, 0.2);
}

.mode-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg,
            var(--primary-color, #4eba8a),
            hsla(var(--primary-hue, 150), 55%, 40%, 1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.mode-card:hover .mode-card-icon {
    transform: scale(1.05);
}

.mode-card-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color, #333);
}

.mode-card-desc {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted-text, #666);
    line-height: 1.3;
}

.mode-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--primary-color, #4eba8a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.mode-card[aria-checked="true"] .mode-card-check {
    opacity: 1;
    transform: scale(1);
}

/* Disabled Mode Card (Coming Soon / Under Development) */
.mode-card-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
    filter: grayscale(40%);
}

.mode-card-disabled:hover {
    transform: none;
    border-color: var(--border-color, #ddd);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mode-card-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
    z-index: 1;
}

/* Mode Options Panel */
.mode-options-panel {
    background: var(--card-bg, #f5f5f5);
    border-radius: 10px;
    padding: 16px;
    min-height: 80px;
}

.mode-options-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted-text, #666);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-options-hint i {
    color: var(--primary-color, #4eba8a);
}

/* Range Mode Options */
.mode-range-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mode-range-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color, #333);
    min-width: 50px;
}

.mode-range-selects {
    display: flex;
    gap: 8px;
    flex: 1;
}

.mode-range-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
    cursor: pointer;
}

.mode-range-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mode-loop-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-color, #555);
    cursor: pointer;
    padding: 8px 0;
}

.mode-loop-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color, #4eba8a);
}

/* Mushaf Mode Options */
.mode-mushaf-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mode-mushaf-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color, #333);
}

.mode-page-input {
    width: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    background: var(--card-bg, #fff);
    color: var(--text-color, #333);
}

.mode-page-input:focus {
    outline: none;
    border-color: var(--primary-color, #4eba8a);
    box-shadow: 0 0 0 3px hsla(var(--primary-hue, 150), 50%, 50%, 0.2);
}

/* Modal Footer */
.mode-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
    justify-content: flex-end;
}

.mode-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn-cancel {
    background: transparent;
    color: var(--muted-text, #666);
    border: 1px solid var(--border-color, #ddd);
}

.mode-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mode-btn-start {
    background: linear-gradient(135deg,
            var(--primary-color, #4eba8a),
            hsla(var(--primary-hue, 150), 50%, 40%, 1));
    color: white;
}

.mode-btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(var(--primary-hue, 150), 50%, 50%, 0.3);
}

/* Bottom Bar Mode Button */
.btn-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.btn-mode .mode-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-mode.is-active {
    background: var(--primary-color, #4eba8a);
    color: white;
}

/* Dark Mode Adjustments */
body.dark-mode .mode-modal-content {
    background: var(--card-bg-dark, #1f2421);
}

body.dark-mode .mode-modal-header {
    background: linear-gradient(135deg,
            hsla(var(--primary-hue, 150), 30%, 20%, 1),
            hsla(var(--primary-hue, 150), 25%, 15%, 1));
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mode-card {
    background: var(--card-bg-dark, #2a2f2d);
}

body.dark-mode .mode-card-disabled {
    opacity: 0.4;
    filter: grayscale(50%);
}

body.dark-mode .mode-card[aria-checked="true"] {
    background: linear-gradient(135deg,
            hsla(var(--primary-hue, 150), 30%, 25%, 1),
            hsla(var(--primary-hue, 150), 25%, 20%, 1));
}

body.dark-mode .mode-options-panel {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .mode-range-select,
body.dark-mode .mode-page-input {
    background: var(--card-bg-dark, #2a2f2d);
    border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .mode-modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 500px) {
    .mode-cards {
        flex-direction: column;
    }

    .mode-card {
        flex-direction: row;
        text-align: left;
        padding: 14px;
        gap: 12px;
    }

    .mode-card-icon {
        width: 40px;
        height: 40px;
        margin: 0;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .mode-card-title {
        font-size: 0.9rem;
    }

    .mode-card-desc {
        font-size: 0.7rem;
    }

    .mode-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .mode-range-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .mode-range-label {
        min-width: auto;
    }

    .mode-range-selects {
        width: 100%;
    }
}