@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #81C784;
    --accent: #FF9800;
    --danger: #F44336;
    --success: #4CAF50;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   NAVIGATION BAR
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-brand img {
    height: 38px;
    width: 38px;
    border-radius: 9px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a,
.nav-dropdown>span {
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s, opacity 0.2s;
    cursor: pointer;
}

.nav-links a:hover,
.nav-dropdown:hover>span {
    background: rgba(255, 255, 255, 0.15);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    padding: 8px 0;
    margin-top: 8px;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 0;
    font-weight: 500;
}

.nav-dropdown-content a:hover {
    background: #f5f5f7;
}

.nav-dropdown-content .dropdown-icon {
    font-size: 1.2rem;
}

.nav-cta {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 20px !important;
    padding: 10px 20px !important;
}

.nav-cta:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Mobile Menu */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.nav-hamburger span {
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.nav-mobile-menu.active {
    display: block;
}

.nav-mobile-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.nav-mobile-menu a:hover {
    background: #f5f5f7;
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }
}

/* Body offset for fixed navbar */
body.has-navbar {
    padding-top: var(--nav-height);
}

/* ========================================
   HERO SECTIONS
   ======================================== */
.hero-blue {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 40px;
    text-align: center;
}

.hero-blue h1 {
    color: white;
    -webkit-text-fill-color: white;
    background: none;
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-blue p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   PAGE CONTAINER (with navbar offset)
   ======================================== */
.page-content {
    flex: 1;
    padding: 40px 20px;
}

/* Glassmorphism Container */
.legal-container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.faq-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.faq-sidebar {
    width: 250px;
    position: sticky;
    top: 110px;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-left: 15px;
}

.faq-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #eee;
}

.faq-sidebar li {
    margin: 0;
}

.faq-sidebar a {
    display: block;
    padding: 10px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.faq-sidebar a:hover {
    color: var(--primary);
}

.faq-sidebar a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
}

main.with-sidebar {
    flex: 1;
    text-align: left;
}

main.with-sidebar h1 {
    text-align: left;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    color: var(--primary);
}

p,
li {
    line-height: 1.6;
    font-size: 1.1rem;
    color: #444;
}

/* GitHub Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 1rem;
    border-left: 5px solid transparent;
}

.alert-tip {
    background: #e1f5fe;
    color: #01579b;
    border-left-color: #03a9f4;
}

.alert-important {
    background: #fff3e0;
    color: #e65100;
    border-left-color: #ff9800;
}

.alert-warning {
    background: #fff8e1;
    color: #ff8f00;
    border-left-color: #ffc107;
}

/* ========================================
   FEATURES TABLE
   ======================================== */
.features-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.features-intro {
    text-align: center;
    margin-bottom: 40px;
}

.features-intro p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.features-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.features-table th {
    background: #f9f9f9;
    padding: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 2px solid #eee;
}

.features-table th:first-child {
    text-align: left;
}

.features-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.features-table tr:nth-child(even) {
    background: #fafafa;
}

.features-table tr:hover {
    background: #f5f5f7;
}

.category-header td {
    background: var(--primary) !important;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 14px 20px;
}

.feature-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary-light);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
}

.status-check {
    color: var(--primary);
    font-size: 1.3rem;
    text-align: center;
}

.status-x {
    color: var(--danger);
    font-size: 1.3rem;
    text-align: center;
}

/* ========================================
   CONTACT FORM
   ======================================== */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.btn-outline {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: transparent;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 10000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

/* ========================================
   LINK CARDS (Legal Index)
   ======================================== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.legal-card {
    background: white;
    padding: 24px;
    border-radius: 18px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.legal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.legal-card .icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.legal-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.legal-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ========================================
   FORM STYLES (Legacy)
   ======================================== */
.input-group {
    margin-bottom: 25px;
}

input[type="email"] {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

button {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    background: #ccc;
}

/* ========================================
   ACCORDION (FAQ)
   ======================================== */
.faq-section {
    margin-bottom: 40px;
}

.faq-section h2 {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.accordion-item {
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.2s;
}

.accordion-header:hover {
    color: var(--primary);
    background: none;
}

.accordion-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    padding-bottom: 20px;
}

.accordion-content p,
.accordion-content ul {
    margin: 0;
    color: #555;
    font-size: 1.05rem;
}

/* ========================================
   WAVE FOOTER
   ======================================== */
.wave-footer {
    position: relative;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 60px 20px 40px;
    margin-top: auto;
}

.wave-footer::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23007AFF' d='M0,30 C360,60 720,0 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") no-repeat center;
    background-size: cover;
}

.wave-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.wave-footer .footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.wave-footer .footer-links a:hover {
    color: white;
}

.wave-footer .store-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.wave-footer .store-badges img {
    height: 40px;
    transition: transform 0.2s;
}

.wave-footer .store-badges img:hover {
    transform: scale(1.05);
}

.wave-footer .logo-footer {
    height: 40px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.wave-footer .copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Legacy Footer (for pages not yet migrated) */
footer {
    margin-top: auto;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.logo-footer {
    height: 32px;
    opacity: 0.8;
    margin-bottom: 12px;
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */
@media (max-width: 900px) {
    .faq-layout {
        flex-direction: column;
    }

    .faq-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 30px;
        background: #f8f9fa;
        padding: 20px;
        border-radius: 16px;
    }

    .faq-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        border-left: none;
    }

    .faq-sidebar a {
        padding: 8px 16px;
        background: white;
        border: 1px solid #eee;
        border-radius: 20px;
    }

    .faq-sidebar a.active {
        border-color: var(--primary);
    }
}

@media (max-width: 768px) {
    .hero-blue {
        padding: 60px 20px;
    }

    .hero-blue h1 {
        font-size: 2.2rem;
    }

    .features-table th,
    .features-table td {
        padding: 12px;
        font-size: 0.9rem;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .navbar {
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    .legal-container {
        margin: 20px;
        padding: 24px;
    }

    h1 {
        font-size: 2rem;
    }

    .wave-footer .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}