/* ========================================
   TERMS & CONDITIONS - Clean Professional Style
   (Sidebar-Aware + Collapse Support + Full Responsive + Dark Mode)
   ======================================== */

/* === BASE CONTAINER === */
.agreement-container {
    max-width: 1200px;
    margin-left: var(--sidebar-width, 260px); /* ✅ DYNAMIC SIDEBAR SUPPORT */
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 2rem;
    padding: 24px 32px;
    background: #ffffff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.7;
    transition: all 0.3s ease, margin-left 0.3s ease; /* ✅ SMOOTH COLLAPSE */
}

body.ocean-dark-mode .agreement-container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================
   MODAL & GUEST VERSIONS - 0 MARGIN (PERFECTLY CENTERED)
   ======================================== */
.agreement-container-modal,
.agreement-container-guest {
    max-width: 850px;
    margin: 0 auto !important; /* ✅ ALWAYS CENTERED - NO SIDEBAR AFFECT */
    padding: 24px 32px;
    background: #ffffff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.7;
    transition: all 0.3s ease;
}

body.ocean-dark-mode .agreement-container-modal,
body.ocean-dark-mode .agreement-container-guest {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* === CSS VARIABLES FOR SIDEBAR (MATCHES YOUR MAIN CSS) === */
:root {
    --sidebar-expanded-width: 260px;
    --sidebar-collapsed-width: 80px;
    --sidebar-width: var(--sidebar-expanded-width);
}

body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed-width);
}

/* === MOBILE - NO MARGIN === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0; /* ✅ NO MARGIN ON MOBILE */
    }
    
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        max-width: 100%;
        margin: 0 !important; /* ✅ FULL WIDTH MOBILE */
        padding: 20px 16px;
        border-radius: 10px;
    }
}

/* === TABLET PORTRAIT === */
@media (max-width: 576px) {
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        padding: 16px 14px;
        border-radius: 8px;
    }
}

/* === ALL OTHER STYLES (UNCHANGED) === */
/* MAIN SECTION TITLES */
.section-title {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #1e40af;
    margin-top: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 16px;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 8px;
}

body.ocean-dark-mode .section-title {
    color: #93c5fd;
    border-bottom-color: #60a5fa;
}

/* SUBHEADINGS */
.subheading {
    color: #1d4ed8;
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    margin-top: clamp(1.25rem, 3.5vw, 1.75rem);
    margin-bottom: 8px;
    font-weight: 600;
}

body.ocean-dark-mode .subheading {
    color: #93c5fd;
}

/* SUB-SUBHEADINGS */
.sub-subheading {
    color: #2563eb;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    margin-top: clamp(1rem, 2.5vw, 1.25rem);
    margin-bottom: 6px;
    font-weight: 500;
}

body.ocean-dark-mode .sub-subheading {
    color: #60a5fa;
}

/* PARAGRAPH TEXT */
.agreement-text {
    color: #374151;
    margin-bottom: 12px;
    font-size: clamp(0.9rem, 2.2vw, 0.97rem);
}

body.ocean-dark-mode .agreement-text {
    color: #cbd5e1;
}

/* DATE TEXT */
.date-text {
    color: #6b7280;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    margin-bottom: 6px;
}

body.ocean-dark-mode .date-text {
    color: #94a3b8;
}

/* SECTION DIVIDER */
.section-divider {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1.25rem, 3.5vw, 2rem);
}

body.ocean-dark-mode .section-divider {
    border-top-color: #334155;
}

/* LISTS */
.agreement-section ul,
.agreement-section ol {
    padding-left: clamp(16px, 4vw, 24px);
    margin-bottom: 12px;
    color: #374151;
}

.agreement-section li {
    margin-bottom: 6px;
}

body.ocean-dark-mode .agreement-section ul,
body.ocean-dark-mode .agreement-section ol {
    color: #cbd5e1;
}

/* LINKS */
.agreement-section a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

.agreement-section a:hover {
    color: #1e40af;
}

body.ocean-dark-mode .agreement-section a {
    color: #60a5fa;
}

body.ocean-dark-mode .agreement-section a:hover {
    color: #93c5fd;
}

/* SPACER */
.spacer {
    margin: clamp(1rem, 3vw, 1.5rem) 0;
}

/* ========================================
   DESKTOP RESPONSIVE (KEEPS SIDEBAR AWARENESS)
   ======================================== */
@media (min-width: 1400px) {
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        max-width: 1200px;
        padding: 32px 40px;
    }
}

@media (max-width: 1300px) and (min-width: 1200px) {
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        max-width: 1200px;
        padding: 28px 36px;
    }
}

@media (max-width: 1200px) and (min-width: 992px) {
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        max-width: 95%;
        padding: 24px 32px;
    }
}

/* ========================================
   PRINT, ACCESSIBILITY, HIGH CONTRAST (UNCHANGED)
   ======================================== */
@media print {
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        border-radius: 0 !important;
    }
    
    .section-divider {
        border-top-color: #ccc !important;
    }
    
    .section-title,
    .subheading,
    .sub-subheading,
    .agreement-text,
    .date-text {
        color: black !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agreement-section a,
    .agreement-container,
    .agreement-container-modal,
    .agreement-container-guest {
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .agreement-container {
        border-width: 2px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .section-title {
        border-bottom-width: 4px;
    }
    
    body.ocean-dark-mode .agreement-container {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
}

.agreement-section a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

body.ocean-dark-mode .agreement-section a:focus {
    outline-color: #60a5fa;
}