/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-darker: #090d16;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    
    --primary: #10b981;          /* Health Emerald */
    --primary-glow: rgba(16, 185, 129, 0.15);
    --primary-glow-strong: rgba(16, 185, 129, 0.3);
    --secondary: #3b82f6;        /* Apple Health/App Blue */
    --accent: #f59e0b;           /* Warning / Action Orange */
    
    --text-primary: #f8fafc;     /* Near white */
    --text-secondary: #94a3b8;   /* Cool grey */
    --text-muted: #64748b;       /* Darker grey */
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(16, 185, 129, 0.3);
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Layout */
    --header-height: 80px;
    --max-width: 1200px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg-darker) 70%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.3;
    margin-bottom: 1.25rem;
    position: relative;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: var(--primary-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--primary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hero-section .subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.meta-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.meta-label {
    color: var(--text-muted);
}

.meta-value {
    color: var(--primary);
    font-weight: 500;
}

/* ==========================================================================
   CONTENT LAYOUT GRID
   ========================================================================== */
.content-grid-container {
    max-width: var(--max-width);
    margin: 0 auto 6rem;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    position: relative;
}

/* Sidebar TOC Navigation */
.sidebar-toc {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
}

.toc-nav {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
}

.toc-header {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-list {
    list-style: none;
}

.toc-link {
    display: block;
    padding: 0.65rem 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 2px solid transparent;
    padding-left: 1rem;
    margin-left: -1rem;
}

.toc-link:hover {
    color: var(--text-primary);
    padding-left: 1.25rem;
}

.toc-link.active {
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
    background: linear-gradient(90deg, var(--primary-glow) 0%, transparent 100%);
    padding-left: 1.25rem;
}

/* Policy Content Area */
.policy-body {
    min-width: 0; /* Prevents overflow */
}

.policy-section {
    padding-top: 1rem;
    margin-bottom: 3.5rem;
}

.section-intro {
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
}

.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color) 0%, transparent 100%);
    margin: 4rem 0;
}

/* ==========================================================================
   SECTION 1: CORE PRINCIPLES CARDS
   ========================================================================== */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.principle-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.principle-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary-glow);
    background: rgba(30, 41, 59, 0.6);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.principle-card h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.principle-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION 2: INFO BLOCKS & LISTS
   ========================================================================== */
.sub-block {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
}

.sub-block-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.sub-block-header h3 {
    margin-bottom: 0;
    font-size: 1.35rem;
}

.sub-block-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-block-badge.health {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.sub-block-badge.billing {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.info-list {
    margin-top: 2rem;
    display: grid;
    gap: 1.5rem;
}

.info-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-item-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.bullet-list {
    list-style: none;
    margin-top: 1.5rem;
}

.bullet-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.bullet-list li::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

/* ==========================================================================
   SECTION 3: CALLOUTS
   ========================================================================== */
.callout-box {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.callout-box.info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-secondary);
}

.callout-icon {
    flex-shrink: 0;
    color: var(--secondary);
    display: flex;
    align-items: center;
}

.callout-content {
    line-height: 1.6;
}

/* ==========================================================================
   SECTION 4: DELETION & RETENTION
   ========================================================================== */
.deletion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.deletion-card {
    background: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.deletion-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.deletion-card-header h4 {
    font-size: 1.15rem;
    margin-bottom: 0;
}

.deletion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.deletion-icon.trash {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.deletion-icon.settings {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.deletion-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ==========================================================================
   SECTION 7: CONTACT CARD
   ========================================================================== */
.contact-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.contact-info-text {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.contact-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-value:hover {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    margin-top: auto;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2.5rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN STYLES
   ========================================================================== */

/* Medium Devices (Tablets, small desktop) */
@media (max-width: 1024px) {
    .content-grid-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-bottom: 4rem;
    }
    
    /* Horizontal Sticky Navigation on Mobile */
    .sidebar-toc {
        position: sticky;
        top: var(--header-height);
        left: 0;
        width: 100vw;
        margin-left: -2rem; /* align with container edge */
        margin-right: -2rem;
        z-index: 900;
    }
    
    .toc-nav {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        padding: 0.75rem 2rem;
        display: flex;
        align-items: center;
        gap: 1.5rem;
        overflow-x: auto;
        white-space: nowrap;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    
    .toc-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar for clean slider */
    }
    
    .toc-header {
        display: none; /* Hide 'On this page' title to save space */
    }
    
    .toc-list {
        display: flex;
        gap: 1rem;
    }
    
    .toc-link {
        padding: 0.5rem 0.75rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 4px;
        margin-left: 0;
    }
    
    .toc-link:hover {
        padding-left: 0.75rem;
    }
    
    .toc-link.active {
        border-bottom-color: var(--primary);
        background: var(--primary-glow);
        padding-left: 0.75rem;
    }
}

/* Small Devices (Mobile Phones) */
@media (max-width: 640px) {
    .header-container {
        padding: 0 1.25rem;
    }
    
    .content-grid-container {
        padding: 0 1.25rem;
    }
    
    .hero-container {
        padding: 0 1.25rem;
    }
    
    .toc-nav {
        padding: 0.75rem 1.25rem;
    }
    
    .principles-grid, .deletion-grid {
        grid-template-columns: 1fr;
    }
    
    .sub-block {
        padding: 1.5rem;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
}
