/* =============================================================================
   AFTER_CLEAR.css - Sleek Mobile-First Design with App-Like Enhancements
   ============================================================================= */

/* --- Base Theme Styles --- */
html,
body {
    background-color: #101010;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
}

a {
    color: white;
}

a:hover {
    color: #28a745;
}

/* =============================================================================
   APP-LIKE FORM CONTAINER - Makes it feel like a standalone app
   ============================================================================= */

.container-fluid {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

#preClearForm {
    position: relative;
    overflow: hidden;
    background: rgba(26, 26, 26, 0.6);
    border-radius: 20px;
    padding: 32px 24px 24px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* =============================================================================
   ENHANCED STEP HEADERS - Smooth, prominent, app-like
   ============================================================================= */

h5.text-info {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    margin-bottom: 24px !important;
    color: #20c997 !important;
    position: relative;
    padding-left: 16px;
    animation: fadeInSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Animated accent bar on step headers */
h5.text-info::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    animation: barGrow 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

/* Smooth fade-in slide animation for headers */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes barGrow {
    from {
        height: 0%;
    }
    to {
        height: 70%;
    }
}

/* =============================================================================
   ENHANCED FORM STEP CONTAINERS
   ============================================================================= */

.form-step {
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease;
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    min-height: 200px;
    padding: 32px 16px 120px 16px;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.form-step.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.form-step.slide-out-right {
    transform: translateX(100%);
    opacity: 0;
}

.form-step.slide-in-left {
    transform: translateX(-100%);
}

.form-step.slide-in-right {
    transform: translateX(100%);
}

/* --- Utility Classes --- */
.hidden {
    display: none !important;
}

.clicked {
    background-color: #28a745;
    color: white;
}

/* --- Squeeze Container --- */
#squeezeContainer {
    display: none;
}

/* --- Row Selection Container --- */
#rowSelectionContainer {
    margin-top: 1rem;
}

/* --- Bay Submitted Recently Indicator --- */
.bay-submitted-recently {
    outline: 3px solid #28a745 !important;
    outline-offset: 1px;
    transition: outline 0.3s ease-in-out;
}

/* =============================================================================
   Sleek Checkbox/Radio Styling - Mobile First
   ============================================================================= */

/* Hide default checkbox/radio */
.form-check-input[type="checkbox"],
.form-check-input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Compact card-based design */
.form-check {
    position: relative;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.form-check-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 1.5px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding-left: 16px !important;
}

/* Compact indicator */
.form-check-label::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #28a745;
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

/* Radio buttons - circular */
input[type="radio"] + .form-check-label::after {
    border-radius: 50%;
}

/* Checked state */
.form-check-input:checked + .form-check-label {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.form-check-input:checked + .form-check-label::after {
    background-color: #28a745;
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Radio checked - dot instead of checkmark */
input[type="radio"]:checked + .form-check-label::after {
    background-image: none;
    box-shadow: inset 0 0 0 4px #1e4620;
}

/* Hover effect */
.form-check:hover .form-check-label {
    border-color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

/* Focus for accessibility */
.form-check-input:focus + .form-check-label {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Remove pseudo-element adjustments that were overriding our design */
.form-check-label::before {
    display: none;
}

/* =============================================================================
   Compact Grid Layouts for Mobile
   ============================================================================= */

/* House Selection - 2 column grid on mobile */
#houseSelectionContainer .row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 0;
}

#houseSelectionContainer .row > div {
    padding: 0;
    margin: 0;
}

/* Bay Buttons - Compact design */
#baySelectionContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

#baySelectionContainer button {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid #333;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    color: white;
    transition: all 0.2s ease;
}

#baySelectionContainer button:hover {
    border-color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

#baySelectionContainer button.btn-success {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* Row checkboxes - 2 column grid */
#bayRowCheckboxes {
    padding: 12px !important;
}

.bay-rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.bay-rows .form-check-inline {
    display: block;
    margin: 0;
}

/* Size selection - single column for better readability */
#sizeSelectionRadioButtons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#sizeSelectionRadioButtons .form-check-inline {
    display: block;
    margin: 0;
}

/* =============================================================================
   Sleek Progress Bar (Bottom Fixed)
   ============================================================================= */

.step-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(16, 16, 16, 0) 0%, rgba(16, 16, 16, 0.95) 20%, #101010 100%);
    padding: 16px 20px;
    z-index: 1000;
    border-top: 1px solid #2a2a2a;
}

/* Sleeker progress track */
.progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background-color: #2a2a2a;
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 12px;
}

/* Animated progress fill */
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0) 100%);
    animation: shimmer 2s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Compact step labels */
.step-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-label {
    flex: 1;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.step-label.completed {
    color: #28a745;
}

.step-label.active {
    color: #fff;
    font-weight: 700;
}

.step-label.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #28a745;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =============================================================================
   Compact Navigation Buttons
   ============================================================================= */

.step-navigation {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 24px;
}

.step-navigation button {
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.step-navigation button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.step-navigation button:active {
    transform: translateY(0);
}

.step-navigation .btn-secondary {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    min-width: 80px;
}

.step-navigation .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4449 100%);
}

.step-navigation .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.step-navigation .btn-primary:hover {
    background: linear-gradient(135deg, #0069d9 0%, #004085 100%);
}

.step-navigation .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    font-size: 16px;
    grid-column: 1 / -1;
}

.step-navigation .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #155724 100%);
}

/* Arrow icons */
.step-navigation button[onclick*="nextStep"]::after {
    content: " →";
    margin-left: 6px;
}

.step-navigation button[onclick*="previousStep"]::before {
    content: "← ";
    margin-right: 6px;
}

/* =============================================================================
   Submission Summary
   ============================================================================= */

.submission-summary {
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid #28a745;
    margin-top: 12px;
}

.submission-summary p {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.submission-summary p:last-child {
    margin-bottom: 0;
}

.submission-summary strong {
    color: #28a745;
    display: inline-block;
    min-width: 120px;
}

/* =============================================================================
   Input Styling
   ============================================================================= */

input[type="number"].form-control {
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 1.5px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    min-height: 44px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

input[type="number"].form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
    outline: none;
}

.form-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ddd;
}

/* =============================================================================
   Mobile Optimizations
   ============================================================================= */

@media (max-width: 768px) {
    .container-fluid {
        padding: 12px;
    }

    #preClearForm {
        padding: 24px 16px 16px 16px;
        border-radius: 16px;
    }

    .form-step {
        padding: 24px 12px 110px 12px;
    }

    h5.text-info {
        font-size: 1.4rem !important;
        margin-bottom: 20px !important;
    }

    .p-3 {
        padding: 12px !important;
    }

    /* Ensure inputs don't trigger zoom on iOS */
    input[type="number"].form-control {
        font-size: 16px;
    }

    /* Compact summary on mobile */
    .submission-summary strong {
        display: block;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    h5.text-info {
        font-size: 1.3rem !important;
    }

    .step-labels {
        font-size: 10px;
    }

    .step-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0 2px;
    }
}

/* Larger screens - spread out a bit more */
@media (min-width: 769px) {
    .container-fluid {
        padding: 32px;
    }

    #preClearForm {
        padding: 40px 32px 32px 32px;
    }

    h5.text-info {
        font-size: 1.75rem !important;
        margin-bottom: 28px !important;
    }

    #houseSelectionContainer .row {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    #baySelectionContainer {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }

    .bay-rows {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    #sizeSelectionRadioButtons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .step-navigation {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .form-step {
        padding-bottom: 140px;
    }
}

/* =============================================================================
   Squeeze Button Styling
   ============================================================================= */

#squeezeButtonContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border-radius: 12px;
    border: 1.5px solid #2a2a2a;
}

.btn-squeeze {
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: 2px solid #333;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-squeeze:hover {
    border-color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* Active/Selected Squeeze */
.btn-squeeze.btn-squeeze-selected,
.btn-squeeze.active {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

/* Squeeze with existing data - GLOWING effect */
.btn-squeeze.has-data {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-color: #28a745;
    animation: pulseGlow 2s infinite;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.6), 
                0 0 40px rgba(40, 167, 69, 0.4),
                inset 0 0 10px rgba(40, 167, 69, 0.2);
}

.btn-squeeze.has-data::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(40, 167, 69, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shimmerSqueeze 3s linear infinite;
}

.btn-squeeze.has-data::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.8);
}

/* Squeeze with PARTIAL data - Subtle orange indicator */
.btn-squeeze.has-partial-data {
    background: linear-gradient(135deg, #3d2e1f 0%, #4a3624 100%);
    border-color: #ff9800;
    animation: subtlePulse 3s infinite;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3), 
                inset 0 0 5px rgba(255, 152, 0, 0.1);
}

.btn-squeeze.has-partial-data::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ff9800;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
    animation: partialBlink 2s infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 152, 0, 0.3), 
                    inset 0 0 5px rgba(255, 152, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 152, 0, 0.4), 
                    inset 0 0 8px rgba(255, 152, 0, 0.15);
    }
}

@keyframes partialBlink {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Squeeze that's been submitted in current session */
.btn-squeeze.recently-submitted {
    animation: successPulse 1s ease-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6), 
                    0 0 40px rgba(40, 167, 69, 0.4),
                    inset 0 0 10px rgba(40, 167, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(40, 167, 69, 0.8), 
                    0 0 60px rgba(40, 167, 69, 0.6),
                    inset 0 0 15px rgba(40, 167, 69, 0.3);
    }
}

@keyframes shimmerSqueeze {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(40, 167, 69, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading state for squeeze buttons */
.btn-squeeze.checking {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.btn-squeeze.checking::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #28a745;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile adjustments for squeeze buttons */
@media (max-width: 768px) {
    #squeezeButtonContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .btn-squeeze {
        padding: 16px 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    #squeezeButtonContainer {
        grid-template-columns: 1fr;
    }
    
    .btn-squeeze {
        padding: 18px 20px;
    }
}

/* =============================================================================
   Reading Type Selection (Step 3) - Sleek Card Design
   ============================================================================= */

#readingTypeSelectionContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

#readingTypeSelectionContainer > div {
    padding: 0 !important;
}

.btn-reading-type {
    width: 100%;
    min-height: 160px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 2px solid #333;
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn-reading-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-reading-type:hover {
    transform: translateY(-4px);
    border-color: #28a745;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.2);
}

.btn-reading-type:hover::before {
    opacity: 1;
}

/* Active/Selected state */
.btn-reading-type.btn-reading-selected,
.btn-reading-type.btn-success.active {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.2), 0 8px 24px rgba(40, 167, 69, 0.3);
    transform: translateY(-2px);
}

.btn-reading-type.btn-reading-selected::after,
.btn-reading-type.btn-success.active::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    animation: checkmarkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Image styling within reading type buttons */
#readingTypeSelectionContainer img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: brightness(0.9) contrast(1.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn-reading-type:hover img {
    filter: brightness(1.1) contrast(1.2);
    transform: scale(1.1);
}

.btn-reading-type.btn-reading-selected img,
.btn-reading-type.btn-success.active img {
    filter: brightness(1.2) saturate(1.3);
    transform: scale(1.05);
}

/* Add subtle glow behind images when selected */
.btn-reading-type.btn-reading-selected img,
.btn-reading-type.btn-success.active img {
    filter: drop-shadow(0 0 12px rgba(40, 167, 69, 0.6));
}

/* Button text */
.btn-reading-type span,
.btn-reading-type::after {
    position: relative;
    z-index: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #readingTypeSelectionContainer {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .btn-reading-type {
        min-height: 140px;
        padding: 20px 16px;
    }
    
    #readingTypeSelectionContainer img {
        width: 56px;
        height: 56px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #readingTypeSelectionContainer {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

/* =============================================================================
   Additional Polish
   ============================================================================= */

/* Smooth transitions for visibility changes */
.hidden {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Container borders */
.border.rounded {
    border-color: #2a2a2a !important;
    border-radius: 12px !important;
}

/* Info text color */
.text-info {
    color: #20c997 !important;
}

/* Alert styling */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border-left: 3px solid #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, #4d1f1f 0%, #5c2626 100%);
    border-left: 3px solid #dc3545;
}

/* =============================================================================
   Success Popup Modal
   ============================================================================= */

.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.success-modal {
    background: linear-gradient(135deg, #1e4620 0%, #2d5a2f 100%);
    border: 2px solid #28a745;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(40, 167, 69, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.success-modal-icon {
    width: 64px;
    height: 64px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
}

.success-modal-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success-modal h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease 0.3s backwards;
}

.success-modal-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    animation: fadeInUp 0.5s ease 0.4s backwards;
}

.success-modal-details p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #e0e0e0;
}

.success-modal-details strong {
    color: #28a745;
    font-weight: 600;
}

.success-modal-close {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    animation: fadeInUp 0.5s ease 0.5s backwards;
}

.success-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.success-modal-close:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .success-modal {
        padding: 28px 20px;
    }
    
    .success-modal h3 {
        font-size: 20px;
    }
    
    .success-modal-icon {
        width: 56px;
        height: 56px;
    }
    
    .success-modal-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .success-modal-details p {
        font-size: 14px;
    }
}

/* =============================================================================
   Warning Popup Modal (Red Theme)
   ============================================================================= */

.warning-modal {
    background: linear-gradient(135deg, #4d1f1f 0%, #5c2626 100%);
    border: 2px solid #dc3545;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(220, 53, 69, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.warning-modal-icon {
    width: 64px;
    height: 64px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.6);
}

.warning-modal-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.warning-modal h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    animation: fadeInUp 0.5s ease 0.3s backwards;
}

.warning-modal-message {
    color: #ffcccc;
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
    animation: fadeInUp 0.5s ease 0.35s backwards;
}

.warning-modal-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    animation: fadeInUp 0.5s ease 0.4s backwards;
    max-height: 200px;
    overflow-y: auto;
}

.warning-modal-details p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    text-align: left;
}

.warning-modal-details strong {
    color: #ff6b6b;
    font-weight: 600;
}

.warning-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
    animation: fadeInUp 0.5s ease 0.5s backwards;
}

.warning-modal-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warning-modal-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.warning-modal-continue {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warning-modal-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
    background: linear-gradient(135deg, #e4606d 0%, #d52a3a 100%);
}

.warning-modal-cancel:active,
.warning-modal-continue:active {
    transform: translateY(0);
}

/* Mobile adjustments for warning modal */
@media (max-width: 480px) {
    .warning-modal {
        padding: 28px 20px;
    }
    
    .warning-modal h3 {
        font-size: 20px;
    }
    
    .warning-modal-icon {
        width: 56px;
        height: 56px;
    }
    
    .warning-modal-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .warning-modal-message {
        font-size: 14px;
    }
    
    .warning-modal-details p {
        font-size: 13px;
    }
    
    .warning-modal-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}