/* Legal Compliance Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid #333;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.modal-header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.modal-logo {
    width: 140px;
    height: auto;
    margin: 0;
    /* White logo on dark modal background */
    filter: brightness(0) invert(1);
}

.modal-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-subtitle {
    font-size: 18px;
    color: #888;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 300;
}

.modal-content {
    margin-bottom: 30px;
}

.warning-box {
    background: rgba(139, 111, 71, 0.1);
    border: 1px solid #8B6F47;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.warning-box h3 {
    color: #8B6F47;
    margin: 0 0 15px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-icon {
    font-size: 24px;
}

.disclaimer-section {
    margin-bottom: 25px;
}

.disclaimer-section h4 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
}

.disclaimer-section p {
    color: #aaa;
    line-height: 1.6;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.disclaimer-section ul {
    color: #aaa;
    margin: 10px 0 10px 20px;
    padding-left: 20px;
}

.disclaimer-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 14px;
}

.age-verification {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.age-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.age-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #8B6F47;
}

.age-checkbox-label {
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-btn {
    background: #8B6F47;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.modal-btn:hover:not(:disabled) {
    background: #A0826D;
    transform: translateY(-1px);
}

.modal-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
    opacity: 0.6;
}

.modal-btn:disabled:hover {
    transform: none;
}

.exit-btn {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 12px 20px;
}

.exit-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #888;
    color: #fff;
}

.legal-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    line-height: 1.5;
}

.highlight-text {
    color: #8B6F47;
    font-weight: 500;
}

/* ===== Image Preview Modal Styles ===== */
.image-preview-modal .modal-container {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

/* Modal Status Display */
.modal-status {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.modal-status.error {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.modal-status.success {
    border-left-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.modal-status.loading {
    border-left-color: #6a5acd;
    background: rgba(106, 90, 205, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        background: rgba(106, 90, 205, 0.1);
        border-left-color: #6a5acd;
    }
    50% {
        background: rgba(106, 90, 205, 0.2);
        border-left-color: #7d6ed8;
    }
}

.modal-status .status-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-status .status-message {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
}

.modal-status.error .status-message {
    color: #ff6b6b;
}

.modal-status.success .status-message {
    color: #51cf66;
}

.modal-status .status-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.modal-status .status-progress-fill {
    height: 100%;
    background: #6a5acd;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.preview-container {
    padding: 30px;
    position: relative;
}

/* Close Button (X) */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #666;
    transform: scale(1.05);
}

.modal-close-btn:active {
    transform: scale(0.95);
}

.modal-close-btn svg {
    color: #aaa;
    transition: color 0.2s ease;
}

.modal-close-btn:hover svg {
    color: #fff;
}

.preview-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.preview-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-label {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-image-container {
    position: relative;
    background: #2a2a2a;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #6a5acd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-controls {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.3s ease;
}

.checkbox-label.processing {
    opacity: 0.5;
    pointer-events: none;
}

/* Threshold Slider Styles */
.threshold-slider-container {
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #333;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #e0e0e0;
}

.threshold-value {
    font-weight: 600;
    color: #6a5acd;
    font-size: 13px;
}

.slider-track {
    position: relative;
}

#threshold-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #666 0%, #6a5acd 50%, #888 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #6a5acd;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#threshold-slider::-webkit-slider-thumb:hover {
    background: #7d6ed8;
    transform: scale(1.1);
}

#threshold-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #6a5acd;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#threshold-slider::-moz-range-thumb:hover {
    background: #7d6ed8;
    transform: scale(1.1);
}

.slider-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 2px;
}

.marker-label {
    font-size: 11px;
    color: #888;
    text-align: center;
    flex: 1;
}

.marker-label:first-child {
    text-align: left;
}

.marker-label:last-child {
    text-align: right;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: #6a5acd;
    color: #fff;
}

.btn-primary:hover {
    background: #7d6ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 90, 205, 0.3);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #888;
    color: #fff;
}

.modal-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        padding: 25px 20px;
        width: 100%;
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-header-content {
        gap: 15px;
    }
    
    .modal-logo {
        width: 100px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .disclaimer-section p,
    .disclaimer-section li {
        font-size: 13px;
    }
    
    .age-checkbox-label {
        font-size: 14px;
    }
    
    .modal-btn {
        font-size: 15px;
        padding: 12px 25px;
    }
    
    .legal-text {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .modal-footer {
        padding-bottom: 10px;
    }

    /* Preview Modal Mobile */
    .preview-comparison {
        grid-template-columns: 1fr;
    }

    .preview-image-container {
        min-height: 200px;
    }

    .preview-image {
        max-height: 250px;
    }

    .preview-container {
        padding: 20px;
    }

    /* Threshold Slider Mobile */
    .threshold-slider-container {
        padding: 12px;
    }

    .slider-label {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .threshold-value {
        font-size: 12px;
    }

    .marker-label {
        font-size: 10px;
    }

    #threshold-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    #threshold-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    /* Close Button Mobile */
    .modal-close-btn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}