/* ============================================
   TERMS & CONDITIONS - FULLY RESPONSIVE CSS
   Mobile-First Approach with Modern CSS
   ============================================ */

/* ============================================
   1. CSS RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* Base font size for rem calculations */
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   2. MOBILE APP HEADER (Fixed)
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    min-width: 44px; /* Touch target size */
    min-height: 44px;
}

.back-button:hover,
.back-button:focus {
    opacity: 0.7;
    outline: 2px solid #E75A5A;
    outline-offset: 2px;
}

.app-header h1 {
    font-size: clamp(1rem, 4vw, 1.125rem); /* Responsive font size */
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

/* ============================================
   3. MAIN CONTENT AREA
   ============================================ */
.terms-content {
    margin-top: 60px; /* Header height */
    padding: 1.25rem 1rem 2.5rem;
    background: #ffffff;
    min-height: calc(100vh - 60px);
    flex: 1;
}

.terms-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   4. PAGE TITLE SECTION
   ============================================ */
.page-title {
    margin-bottom: 1.5rem;
    text-align: center;
}

.page-title h2 {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.last-updated {
    font-size: clamp(0.875rem, 3vw, 1rem);
    color: #666666;
    margin-bottom: 1rem;
}

.last-updated strong {
    color: #1a1a1a;
    font-weight: 600;
}

.intro-text {
    font-size: clamp(0.9375rem, 3.5vw, 1.0625rem);
    color: #4a4a4a;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* ============================================
   5. TERMS SECTIONS
   ============================================ */
.terms-section {
    margin-bottom: 2rem;
    scroll-margin-top: 80px; /* Offset for fixed header */
}

.terms-section h3 {
    font-size: clamp(1.125rem, 4vw, 1.25rem);
    font-weight: 600;
    color: #E75A5A;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    line-height: 1.3;
}

.section-number {
    color: #E75A5A;
    font-weight: 700;
    flex-shrink: 0;
}

.terms-section h4 {
    font-size: clamp(1rem, 3.5vw, 1.125rem);
    font-weight: 600;
    color: #1a1a1a;
    margin: 1rem 0 0.625rem;
    line-height: 1.4;
}

.terms-section p {
    font-size: clamp(0.9375rem, 3.5vw, 1rem);
    color: #4a4a4a;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   6. LISTS (UL & OL)
   ============================================ */
.terms-section ul,
.terms-section ol {
    margin: 0.75rem 0 0.75rem 1.25rem;
    padding: 0;
}

.terms-section ul li,
.terms-section ol li {
    font-size: clamp(0.9375rem, 3.5vw, 1rem);
    color: #4a4a4a;
    line-height: 1.7;
    margin-bottom: 0.625rem;
    padding-left: 0.5rem;
    word-wrap: break-word;
}

.terms-section ul li::marker {
    color: #E75A5A;
}

.terms-section ol li::marker {
    color: #E75A5A;
    font-weight: 600;
}

/* ============================================
   7. LINKS
   ============================================ */
.terms-section a {
    color: #E75A5A;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
    transition: color 0.2s ease;
}

.terms-section a:hover,
.terms-section a:focus {
    text-decoration: underline;
    color: #d44444;
}

/* ============================================
   8. IMPORTANT BOX (Blue Highlight)
   ============================================ */
.important-box {
    background: #2563EB;
    color: #ffffff;
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.important-box p {
    color: #ffffff;
    margin: 0;
    font-size: clamp(0.875rem, 3vw, 0.9375rem);
    line-height: 1.6;
}

.important-box strong {
    font-weight: 600;
}

/* ============================================
   9. CONTACT BOX
   ============================================ */
.contact-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    display: block;
}

.contact-box h4 {
    font-size: clamp(1rem, 3.5vw, 1.125rem);
    font-weight: 700;
    color: #E75A5A;
    margin-bottom: 1.25rem;
    display: block;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 0.5rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item i {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: #E75A5A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-item > div {
    flex: 1;
    min-width: 0;
}

.contact-item strong {
    display: block;
    font-size: clamp(0.8125rem, 3vw, 0.875rem);
    color: #666666;
    margin-bottom: 0.375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-item p {
    margin: 0;
    font-size: clamp(0.9375rem, 3.5vw, 1rem);
    color: #1a1a1a;
    word-break: break-word;
    line-height: 1.6;
    font-weight: 500;
}

.contact-item a {
    color: #E75A5A;
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* ============================================
   10. FINAL AGREEMENT BOX
   ============================================ */
.final-agreement {
    background: #E75A5A;
    color: #ffffff;
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.final-agreement i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.final-agreement p {
    margin: 0;
    font-size: clamp(0.9375rem, 3.5vw, 1rem);
    line-height: 1.6;
    color: #ffffff;
}

/* ============================================
   11. BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: #E75A5A;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(231, 90, 90, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover,
.back-to-top:focus {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(231, 90, 90, 0.5);
}

.back-to-top.show {
    display: flex;
}

/* ============================================
   12. RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small Mobile (320px - 479px) */
@media (min-width: 320px) and (max-width: 479px) {
    .terms-content {
        padding: 1rem 0.75rem 2rem;
    }
    
    .terms-section {
        margin-bottom: 1.5rem;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Mobile (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .terms-content {
        padding: 1.5rem 1rem 2.5rem;
    }
    
    .terms-container {
        max-width: 100%;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) {
    .app-header {
        padding: 0 2rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .terms-content {
        padding: 2rem 2.5rem 3.75rem;
    }
    
    .terms-container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .page-title h2 {
        font-size: 1.75rem;
    }
    
    .terms-section h3 {
        font-size: 1.25rem;
    }
    
    .contact-box {
        padding: 1.5rem;
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) {
    .app-header {
        padding: 0 2.5rem;
    }
    
    .app-header h1 {
        font-size: 1.25rem;
    }
    
    .terms-content {
        padding: 2.5rem 3.75rem 5rem;
    }
    
    .terms-container {
        max-width: 900px;
    }
    
    .page-title {
        margin-bottom: 2rem;
    }
    
    .terms-section {
        margin-bottom: 2.5rem;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .terms-container {
        max-width: 1000px;
    }
    
    .terms-content {
        padding: 3rem 4rem 6rem;
    }
}

/* ============================================
   13. PRINT STYLES
   ============================================ */
@media print {
    .app-header,
    .back-to-top,
    .footer {
        display: none;
    }
    
    .terms-content {
        margin-top: 0;
        padding: 0;
    }
    
    .terms-section {
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
}

/* ============================================
   14. ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #E75A5A;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .terms-section h3,
    .section-number {
        color: #d44444;
    }
    
    .important-box {
        border: 2px solid #1a1a1a;
    }
}

/* ============================================
   15. SMOOTH ANIMATIONS
   ============================================ */
.terms-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   16. UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.no-wrap {
    white-space: nowrap;
}

.break-word {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   END OF STYLES
   ============================================ */
