/* ============================================
   TERMS MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.modal--active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal__container {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    max-width: 700px;
    max-height: 85vh;
    width: 95%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal__container--terms {
    border-top: 4px solid var(--primary);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal__title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin: 0;
}

.modal__header-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal__finish-warning {
    margin: 0;
    font-size: var(--text-sm);
    color: #ef4444;
    font-weight: var(--font-bold);
}

.modal__finish-warning strong {
    color: #ff6b6b;
    font-size: 1.1em;
    padding: 0.1em 0.4em;
    background: rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal__close:hover {
    color: var(--text-primary);
}

.modal__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

.modal__footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

/* Terms Content */
.terms-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

.terms-intro {
    font-size: var(--text-base);
    color: var(--text-primary);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.terms-section {
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--border-subtle);
}

.terms-section h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--space-3) 0;
}

.terms-section p {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-sm);
}

.terms-section--booking p:first-of-type {
    font-size: var(--text-base);
    line-height: 2;
}

.terms-section p:last-child {
    margin-bottom: 0;
}

.terms-section ul {
    margin: var(--space-2) 0;
    padding-left: var(--space-5);
}

.terms-section li {
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
}

/* Section Colors */
.terms-section--booking {
    border-left-color: var(--primary);
    background: rgba(0, 212, 255, 0.05);
}

.terms-section--rules {
    border-left-color: #f59e0b;
}

.terms-section--children {
    border-left-color: #8b5cf6;
}

.terms-section--liability {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.terms-section--cctv {
    border-left-color: #6366f1;
}

.terms-section--cancellation {
    border-left-color: #10b981;
}

.terms-section--cleaning {
    border-left-color: #f97316;
}

.terms-section--final {
    border-left-color: var(--primary);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.terms-warning {
    color: #fbbf24 !important;
    font-weight: var(--font-medium);
    font-style: italic;
}

.terms-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

@media (max-width: 640px) {
    .terms-rules {
        grid-template-columns: 1fr;
    }
}

.terms-footer-note {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

#terms-accept-btn {
    white-space: nowrap;
}

#terms-accept-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* Custom scrollbar for modal */
.modal__body::-webkit-scrollbar {
    width: 8px;
}

.modal__body::-webkit-scrollbar-track {
    background: var(--bg-darkest);
    border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header with sticky warning */
.modal__header-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#terms-modal .modal__finish-warning {
    margin: 0;
    font-size: var(--text-lg);
    color: #ff4444;
    font-weight: var(--font-bold);
    background: rgba(239, 68, 68, 0.15);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 2px solid #ef4444;
    text-align: center;
}

#terms-modal .modal__finish-warning strong {
    display: inline-block;
    color: #ffffff;
    font-size: 1.5em;
    padding: 0.2em 0.5em;
    background: #ef4444;
    border-radius: 4px;
    white-space: nowrap;
}

/* Start/End time emphasis */
#terms-start-time,
#terms-end-time,
#terms-date {
    display: inline-block;
    color: #ffffff;
    font-size: 1.3em;
    font-weight: var(--font-bold);
    padding: 0.25em 0.6em;
    background: var(--primary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

#terms-end-time {
    background: #ef4444;
}

#terms-date {
    background: #8b5cf6;
    font-size: 1.1em;
}