/* assets/css/style.css */

:root {
    --primary-color: #4A90E2;
    --primary-hover: #357ABD;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --radius: 16px;
}

#alex-questionnaire-wrapper {
    max-width: 800px;
    margin: 40px auto;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    color: var(--text-color);
}

/* Progress Bar */
#alex-q-progress-container {
    margin-bottom: 20px;
    background: #e0e0e0;
    border-radius: 15px;
    height: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#alex-q-progress-bar {
    height: 100%;
    background: #1d7374;
    width: 0%;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#alex-q-progress-text {
    display: none;
    /* We show it inside the bar now */
}

/* Card Styling - Glassmorphism */
#alex-q-container,
#alex-q-results {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    border: var(--glass-border);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
    min-height: 300px;
    transition: all 0.3s ease;
}

/* Questions */
.alex-q-page {
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.5s;
}

.alex-q-page.active {
    display: block;
}

.alex-question {
    margin-bottom: 25px;
}

.alex-question h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #1d7374;
}

.alex-required-icon {
    color: #e74c3c;
    /* Red asterisk */
    font-weight: bold;
    margin-left: 4px;
}

/* Options */
.alex-option {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.alex-option:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: #1d7374;
}

.alex-option input:checked+span {
    color: #1d7374;
    font-weight: bold;
}

.alex-btn {
    background: #1d7374;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s, background 0.2s;
}

.alex-btn:hover {
    background: #145b5c;
    /* Darker shade of #1d7374 */
    transform: translateY(-1px);
}

/* Controls */
.alex-q-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.alex-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s, box-shadow 0.2s;
}

.alex-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.4);
}

.alex-btn.primary:hover {
    background: var(--primary-hover);
}

.alex-btn.secondary {
    background: transparent;
    color: #666;
    border: 1px solid #ccc;
}

/* Charts */
.alex-charts-container canvas {
    margin-bottom: 30px;
    max-height: 400px;
}

/* Hide Detailed Chart from UI but keep it renderable */
#chart-detailed {
    /* Cannot use display:none or visibility:hidden because Chart.js needs to render */
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 800px;
    /* Force a width for rendering */
    height: 600px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Inputs Modernization */
.alex-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.alex-input:focus,
input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #1d7374 !important;
    box-shadow: 0 0 0 3px rgba(29, 115, 116, 0.2) !important;
    background: #fff;
}

/* Horizontal Options */
.alex-options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.alex-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 20px;
    /* Pill shape */
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    width: auto;
    /* Allow auto width */
    margin-bottom: 0;
    /* Handled by gap */
}

.alex-option:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.alex-option input {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.alex-option.alex-selected {
    background: #1d7374 !important;
    color: #fff !important;
    border-color: #1d7374 !important;
    box-shadow: 0 4px 10px rgba(29, 115, 116, 0.3);
}

/* Scale modernization */
.alex-scale-container {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.alex-scale-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 500;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.alex-scale-option:last-child {
    border-right: none;
}

.alex-scale-option input {
    display: none;
    /* Hide default radio */
}

.alex-scale-option:hover {
    background-color: #f0f7ff;
}

.alex-scale-option.selected {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Custom Centered Popup */
.alex-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.alex-popup-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alex-popup-content p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alex-popup-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s;
}

.alex-popup-content button:hover {
    transform: scale(1.05);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

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