/**
 * Terms of Service Acceptance Modal - CSS Styling
 *
 * Professional, accessible modal design for terms acceptance.
 * Mobile-responsive with clear visual hierarchy.
 *
 * @author Claude Code
 * @date 2026-05-09
 */

/* Modal Overlay - Full screen backdrop */
.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000; /* Very high to overlay everything */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
}

.terms-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

/* Modal Container */
.terms-modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: termsModalSlideIn 0.3s ease-out;
}

@keyframes termsModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation for when user tries to close modal */
.terms-shake {
    animation: termsShake 0.5s ease-in-out;
}

@keyframes termsShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Modal Header */
.terms-modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    color: #ffffff;
    border-radius: 8px 8px 0 0;
}

.terms-modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: bold;
}

.terms-required-notice {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    font-style: italic;
}

/* Modal Body */
.terms-modal-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terms-scroll-container {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
    color: #333333;
}

.terms-scroll-container h3 {
    margin: 20px 0 10px 0;
    font-size: 18px;
    color: #d32f2f;
    font-weight: bold;
}

.terms-scroll-container h3:first-child {
    margin-top: 0;
}

.terms-scroll-container p {
    margin: 10px 0;
    font-size: 14px;
}

.terms-scroll-container ul {
    margin: 10px 0;
    padding-left: 25px;
}

.terms-scroll-container li {
    margin: 8px 0;
    font-size: 14px;
}

.terms-scroll-container a {
    color: #1976d2;
    text-decoration: underline;
}

.terms-scroll-container a:hover {
    color: #1565c0;
}

/* Warning Box */
.terms-warning-box {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    margin: 15px 0;
}

.terms-warning-box p {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #856404;
}

.terms-warning-box ul {
    margin: 10px 0 0 0;
    color: #856404;
}

.terms-warning-box li {
    margin: 8px 0;
}

.terms-date {
    margin-top: 20px;
    font-size: 13px;
    color: #666666;
    font-style: italic;
}

/* Modal Footer */
.terms-modal-footer {
    padding: 20px 30px;
    background-color: #f5f5f5;
    border-top: 1px solid #dddddd;
    border-radius: 0 0 8px 8px;
}

.terms-checkbox-container {
    margin-bottom: 20px;
}

.terms-checkbox-container label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
}

.terms-checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox-container span {
    flex: 1;
}

/* Buttons */
.terms-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.terms-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: Arial, Helvetica, sans-serif;
}

.terms-btn-decline {
    background-color: #9e9e9e;
    color: #ffffff;
}

.terms-btn-decline:hover {
    background-color: #757575;
}

.terms-btn-accept {
    background-color: #4caf50;
    color: #ffffff;
}

.terms-btn-accept:hover:not(:disabled) {
    background-color: #388e3c;
}

.terms-btn-accept:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.terms-footer-note {
    margin: 0;
    font-size: 12px;
    color: #666666;
    text-align: center;
}

/* Scrollbar Styling (Webkit browsers) */
.terms-scroll-container::-webkit-scrollbar {
    width: 10px;
}

.terms-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.terms-scroll-container::-webkit-scrollbar-thumb {
    background: #888888;
    border-radius: 5px;
}

.terms-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .terms-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .terms-modal-header {
        padding: 20px;
    }

    .terms-modal-header h2 {
        font-size: 20px;
    }

    .terms-required-notice {
        font-size: 13px;
    }

    .terms-scroll-container {
        padding: 20px;
    }

    .terms-scroll-container h3 {
        font-size: 16px;
    }

    .terms-scroll-container p,
    .terms-scroll-container li {
        font-size: 13px;
    }

    .terms-modal-footer {
        padding: 15px 20px;
    }

    .terms-buttons {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .terms-btn {
        width: 100%;
        padding: 14px;
    }

    .terms-checkbox-container label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .terms-modal-header h2 {
        font-size: 18px;
    }

    .terms-scroll-container {
        padding: 15px;
    }

    .terms-warning-box {
        padding: 15px;
    }
}

/* Print Styles - Hide modal when printing */
@media print {
    .terms-modal {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .terms-modal-overlay {
        background-color: rgba(0, 0, 0, 0.95);
    }

    .terms-modal-container {
        border: 2px solid #000000;
    }

    .terms-btn {
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .terms-modal-container {
        animation: none;
    }

    .terms-shake {
        animation: none;
    }
}
