/* ==========================================
   Statistic Selection Modal - Material Design
   ========================================== */

.statistic-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.87);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: overlayFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes overlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.statistic-modal-container {
    background: var(--bs-surface-2-bg);
    border-radius: 4px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--bs-border-color);
    animation: modalSlide 0.225s cubic-bezier(0, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.statistic-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--bs-border-color);
}

    .statistic-modal-header .header-title {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 4px;
    }

        .statistic-modal-header .header-title i {
            font-size: 24px;
            color: var(--bs-main-400);
            font-weight: 300;
        }

    .statistic-modal-header h3 {
        margin: 0;
        font-size: 20px;
        font-weight: 500;
        color: var(--bs-body-color);
        letter-spacing: 0.15px;
    }

    .statistic-modal-header .header-subtitle {
        margin: 0;
        font-size: 14px;
        color: var(--bs-text-muted);
        font-weight: 400;
        line-height: 20px;
        letter-spacing: 0.25px;
    }

.statistic-modal-body {
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
}

    .statistic-modal-body::-webkit-scrollbar {
        width: 8px;
    }

    .statistic-modal-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .statistic-modal-body::-webkit-scrollbar-thumb {
        background: var(--bs-border-strong);
        border-radius: 4px;
    }

        .statistic-modal-body::-webkit-scrollbar-thumb:hover {
            background: var(--bs-border-color);
        }

.statistic-group {
    padding: 16px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--bs-border-color);
}

    .statistic-group:last-child {
        border-bottom: none;
    }

.statistic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

    .statistic-header i {
        font-size: 20px;
        color: var(--bs-text-muted);
        font-weight: 300;
    }

.statistic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-body-color);
    flex: 1;
    letter-spacing: 0.1px;
    text-transform: uppercase;
}

.required-badge {
    background: transparent;
    color: var(--bs-main-400);
    font-size: 11px;
    font-weight: 500;
    padding: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.statistic-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.statistic-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    border-radius: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 48px;
    overflow: hidden;
}

    .statistic-option:hover {
        background: rgba(255, 255, 255, 0.04);
    }

    .statistic-option.active {
        background: rgba(238, 97, 25, 0.08);
    }

        .statistic-option.active::before {
            display: none;
        }

.option-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bs-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
}

.statistic-option.active .option-radio {
    border-color: var(--bs-main-500);
}

    .statistic-option.active .option-radio::before {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--bs-main-500);
        transform: scale(1);
        transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }

.radio-dot {
    display: none;
}

.option-content {
    flex: 1;
}

.option-label {
    font-size: 16px;
    font-weight: 400;
    color: var(--bs-body-color);
    letter-spacing: 0.15px;
    line-height: 24px;
}

.statistic-option.active .option-label {
    font-weight: 500;
    color: var(--bs-body-color);
}

.statistic-modal-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-surface-2-bg);
}

.btn-statistic-action {
    width: 100%;
    padding: 10px 24px;
    background: transparent;
    color: var(--bs-main-400);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 1.25px;
    min-height: 36px;
}

    .btn-statistic-action:hover:not(.disable) {
        background: rgba(238, 97, 25, 0.08);
    }

    .btn-statistic-action:active:not(.disable) {
        background: rgba(238, 97, 25, 0.16);
    }

    .btn-statistic-action.disable {
        color: var(--bs-text-muted);
        cursor: not-allowed;
        opacity: 0.38;
    }

    .btn-statistic-action i {
        font-size: 18px;
        font-weight: 300;
    }

    /* Ripple effect */
    .statistic-option::after,
    .btn-statistic-action::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        pointer-events: none;
        background-image: radial-gradient(circle, var(--bs-main-400) 10%, transparent 10.01%);
        background-repeat: no-repeat;
        background-position: 50%;
        transform: scale(10, 10);
        opacity: 0;
        transition: transform 0.3s, opacity 0.5s;
    }

    .statistic-option:active::after,
    .btn-statistic-action:active::after {
        transform: scale(0, 0);
        opacity: 0.3;
        transition: 0s;
    }

    /* Loading state animation */
    .btn-statistic-action .fa-spinner-third {
        animation: rotate 0.8s linear infinite;
    }

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Focus states for accessibility */
.statistic-option:focus-visible {
    outline: 2px solid var(--bs-main-400);
    outline-offset: 2px;
}

.btn-statistic-action:focus-visible {
    outline: 2px solid var(--bs-main-400);
    outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .statistic-modal-overlay {
        padding: 16px;
    }

    .statistic-modal-container {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 4px;
    }

    .statistic-modal-header {
        padding: 20px 20px 12px;
    }

    .statistic-modal-body {
        padding: 4px 0;
    }

    .statistic-group {
        padding: 12px 20px;
    }

    .statistic-modal-header h3 {
        font-size: 18px;
    }

    .statistic-modal-header .header-subtitle {
        font-size: 13px;
    }

    .statistic-title {
        font-size: 13px;
    }

    .option-label {
        font-size: 15px;
    }

    .btn-statistic-action {
        font-size: 14px;
        padding: 10px 20px;
    }

    .statistic-option {
        padding: 10px 8px;
        min-height: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .statistic-option.active {
        border: 2px solid var(--bs-main-400);
    }

    .option-radio {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .statistic-modal-overlay,
    .statistic-modal-container,
    .statistic-option,
    .btn-statistic-action {
        animation: none;
        transition: none;
    }
}

/* Smooth transitions */
.statistic-option,
.btn-statistic-action,
.option-radio {
    will-change: auto;
}
