/* ============================================
   EatAtHome Terms & Services Page Styles
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors - Warm Orange Palette */
    --primary: #FF6B35;
    --primary-dark: #e55a28;
    --primary-light: #ff8a5c;
    
    /* Text Colors */
    --text-heading: #2c3e50;
    --text-body: #555;
    --text-muted: #888;
    --text-light: #b0b0b0;
    
    /* Background Colors */
    --bg-white: #ffffff;
    --bg-cream: #fdf8f5;
    --bg-section: #faf7f5;
    --bg-footer: #3d3d3d;
    
    /* Border Colors */
    --border-light: #f0ebe8;
    --border-medium: #e0e0e0;
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-brand: 0 4px 12px rgba(255, 107, 53, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-white);
    transition: all 0.3s ease;
}

body[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-heading);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-img {
    height: 50px;
    width: auto;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-heading);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

body[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

.nav-link:hover::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-selector {
    position: relative;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
    display: none;
    min-width: 120px;
    z-index: 1000;
}

body[dir="rtl"] .language-dropdown {
    right: auto;
    left: 0;
}

.language-dropdown.active {
    display: block;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

body[dir="rtl"] .lang-option {
    text-align: right;
}

.lang-option:hover {
    background-color: #f5f5f5;
}

.lang-option:first-child {
    border-radius: 6px 6px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 6px 6px;
}

.btn-host {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-host:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-heading);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
    background-color: var(--bg-section);
    border-bottom: 1px solid var(--border-light);
    padding: 48px 0 64px;
}

.page-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    line-height: 1.2;
    animation: fadeInUp 0.6s ease forwards;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-body);
    max-width: 600px;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

/* Main Content */
.main-content {
    padding: 48px 0;
    min-height: calc(100vh - 200px);
    background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-white) 100%);
}

.content-wrapper {
    display: flex;
    gap: 48px;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.toc-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-body);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

body[dir="rtl"] .toc-link {
    border-left: none;
    border-right: 3px solid transparent;
}

.toc-link:hover {
    background-color: var(--bg-section);
    color: var(--primary);
}

.toc-link.active {
    background-color: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

body[dir="rtl"] .toc-link.active {
    border-left-color: transparent;
    border-right-color: var(--primary);
}

/* Mobile TOC Toggle */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    gap: 8px;
    align-items: center;
}

body[dir="rtl"] .toc-mobile-toggle {
    right: auto;
    left: 24px;
}

.toc-mobile-toggle i {
    font-size: 16px;
}

/* Terms Content */
.terms-content {
    flex: 1;
    max-width: 800px;
}

/* Policy Sections */
.policy-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-light);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.policy-section:last-of-type {
    border-bottom: none;
}

.policy-section:nth-child(1) { animation-delay: 0.1s; }
.policy-section:nth-child(2) { animation-delay: 0.15s; }
.policy-section:nth-child(3) { animation-delay: 0.2s; }
.policy-section:nth-child(4) { animation-delay: 0.25s; }
.policy-section:nth-child(5) { animation-delay: 0.3s; }
.policy-section:nth-child(6) { animation-delay: 0.35s; }
.policy-section:nth-child(7) { animation-delay: 0.4s; }
.policy-section:nth-child(8) { animation-delay: 0.45s; }
.policy-section:nth-child(9) { animation-delay: 0.5s; }
.policy-section:nth-child(10) { animation-delay: 0.55s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
}

.section-content {
    color: var(--text-body);
    font-size: 16px;
    line-height: 1.8;
}

.section-content p {
    margin-bottom: 16px;
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content strong {
    color: var(--text-heading);
    font-weight: 600;
}

.section-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.section-content a:hover {
    text-decoration: underline;
}

.highlight-text {
    font-weight: 500;
    color: var(--text-heading);
}

.policy-list {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

body[dir="rtl"] .policy-list {
    padding-right: 0;
}

.policy-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.7;
}

body[dir="rtl"] .policy-list li {
    padding-left: 0;
    padding-right: 24px;
}

.policy-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 20px;
    line-height: 1.4;
}

body[dir="rtl"] .policy-list li::before {
    left: auto;
    right: 0;
}

/* Contact Box */
.contact-box {
    margin-top: 48px;
    padding: 24px;
    background: var(--bg-section);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.contact-box h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.contact-box p {
    color: var(--text-body);
    font-size: 15px;
}

.contact-box a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.contact-box a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--bg-footer);
    color: #ffffff;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-about {
    max-width: 400px;
}

.footer-about .logo {
    margin-bottom: 20px;
}

.footer-about h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.2;
}

.footer-about p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-light);
}

.footer-contact h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.contact-regions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.contact-region h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
}

.flag-icon {
    width: 24px;
    height: auto;
}

.company-name {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.4;
    text-transform: uppercase;
}

.contact-region p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-region p i {
    color: var(--primary);
    font-size: 14px;
    width: 16px;
}

.contact-region a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-region a:hover {
    color: var(--primary);
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #666;
    border-radius: 50%;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.footer-divider {
    height: 1px;
    background-color: #555;
    margin: 40px 0 30px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover,
.footer-links a.active {
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-regions {
        grid-template-columns: repeat(2, 1fr);
    }

    .toc-sidebar {
        display: none;
    }

    .toc-mobile-toggle {
        display: flex;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .terms-content {
        max-width: 100%;
    }
}

@media (max-width: 968px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 30px;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        gap: 20px;
    }

    body[dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    body[dir="rtl"] .nav-menu.active {
        left: auto;
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .btn-host {
        display: none;
    }

    .page-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .contact-regions {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .page-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 20px;
    }

    .hero-section {
        padding: 32px 0 40px;
    }

    .main-content {
        padding: 32px 0;
    }

    .policy-section {
        margin-bottom: 32px;
        padding-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .toc-mobile-toggle {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
    }

    body[dir="rtl"] .toc-mobile-toggle {
        right: auto;
        left: 16px;
    }
}

/* Mobile TOC Modal */
.toc-sidebar.mobile-active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 1001;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

body[dir="rtl"] .toc-sidebar.mobile-active {
    left: 0;
    right: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.toc-close {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-body);
    cursor: pointer;
}

body[dir="rtl"] .toc-close {
    right: auto;
    left: 16px;
}

.toc-sidebar.mobile-active .toc-close {
    display: block;
}

/* Smooth scroll offset for sticky header */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}