/*
 * HowToLaw.co.nz Design System
 * Trustworthy international dating platform aesthetic
 * Mobile-first responsive design
 */

/* ============================================
   OVERFLOW PREVENTION - Safety Net
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

img, video, iframe, embed, object, svg {
    max-width: 100%;
    height: auto;
}

[class*="grid"] > *,
[class*="flex"] > * {
    min-width: 0;
}

pre, code, .code-block, [class*="code"] {
    max-width: 100%;
    overflow-x: auto;
}

pre code,
.code-block code {
    display: block;
    min-width: 0;
}

.table-wrapper,
[class*="table-"] {
    max-width: 100%;
    overflow-x: auto;
}

p, li, td, th {
    overflow-wrap: break-word;
}

input, textarea, select {
    max-width: 100%;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
}

h2 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
}

h3 {
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 500;
}

p {
    margin: 0 0 24px 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent);
}

ul, ol {
    margin: 0 0 24px 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    max-width: 1280px;
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 48px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    z-index: 1001;
    transition: opacity 0.3s ease;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--muted);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--card);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 80px 24px 24px;
    z-index: 999;
    transition: right 0.3s ease;
}

.main-nav.is-open {
    right: 0;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    transition: all 0.3s ease;
}

.nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--foreground);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--muted);
    color: var(--primary);
}

/* Dropdown menu */
.nav-item-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    color: var(--foreground);
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    background-color: var(--muted);
}

.dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.dropdown-toggle.is-open svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dropdown-menu.is-open {
    max-height: 2000px;
}

.dropdown-menu .nav-link {
    font-size: 15px;
    padding: 10px 16px;
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }

    .main-nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
        overflow: visible;
    }

    .nav-overlay {
        display: none;
    }

    .nav-list {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .nav-link {
        padding: 8px 16px;
    }

    .nav-item-dropdown {
        position: relative;
    }

    .dropdown-toggle {
        padding: 8px 16px;
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 240px;
        background-color: var(--card);
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 8px;
        margin-top: 4px;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .dropdown-menu.is-open {
        max-height: 600px;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-menu .nav-link {
        font-size: 14px;
    }
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 80px;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--foreground);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--muted-foreground);
    font-size: 14px;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted-foreground);
    font-size: 14px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-block {
    width: 100%;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    min-width: 0;
}

.card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   GRID SYSTEMS
   ============================================ */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

/* ============================================
   PROFILE CARDS
   ============================================ */

.profile-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 0;
}

.profile-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.profile-card h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.profile-card .profile-info {
    color: var(--muted-foreground);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ============================================
   DATING SITES LIST
   ============================================ */

.dating-sites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 32px 0;
}

@media (min-width: 768px) {
    .dating-sites-list {
        gap: 24px;
    }
}

.dating-site-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .dating-site-card {
        padding: 24px 32px;
    }
}

.dating-site-card:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dating-site-name {
    font-family: "Sora", sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--foreground);
}

.dating-site-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
    margin-bottom: 16px;
}

.dating-site-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 768px) {
    .dating-site-actions {
        flex-direction: row;
        gap: 12px;
    }
}

/* ============================================
   REVIEW HERO BLOCK
   ============================================ */

.review-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 12px;
    padding: 24px;
    margin: 32px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .review-hero {
        padding: 32px;
    }
}

@media (min-width: 1024px) {
    .review-hero {
        padding: 48px;
    }
}

.review-hero h2 {
    font-family: "Sora", sans-serif;
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.review-hero-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.review-hero-rating .stars {
    display: flex;
    gap: 4px;
    color: #fbbf24;
}

.review-hero-rating .stars svg {
    width: 24px;
    height: 24px;
}

.review-hero-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.review-hero .btn-primary {
    background-color: #ffffff;
    color: var(--primary);
    font-weight: 600;
    min-height: 56px;
    padding: 16px 32px;
    font-size: 18px;
    animation: pulse-subtle 2s ease-in-out infinite;
}

.review-hero .btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
    animation: none;
}

@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4);
    }
}

/* ============================================
   FAQ ACCORDION
   ============================================ */

.faq-section {
    margin: 48px 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    font-family: "Sora", sans-serif;
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    color: var(--foreground);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
    .faq-question {
        padding: 24px 32px;
    }
}

.faq-question:hover {
    background-color: var(--muted);
}

.faq-question svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-question.is-open svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer-content {
    padding: 0 24px 24px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--foreground);
}

@media (min-width: 768px) {
    .faq-answer-content {
        padding: 0 32px 24px;
    }
}

.faq-answer.is-open {
    max-height: 1000px;
}

/* ============================================
   KEY TAKEAWAYS & SUMMARY BOXES
   ============================================ */

.key-takeaways,
.summary-box {
    background-color: var(--accent);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.1) 0%, rgba(8, 145, 178, 0.05) 100%);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 24px;
    margin: 32px 0;
}

.key-takeaways h2,
.summary-box h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--foreground);
}

.key-takeaways ul,
.summary-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

.key-takeaways li,
.summary-box li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* ============================================
   COMPARISON TABLE
   ============================================ */

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    min-width: 0;
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    font-family: "Sora", sans-serif;
    font-weight: 600;
    background-color: var(--muted);
    color: var(--foreground);
}

.comparison-table tr:hover {
    background-color: var(--muted);
}

@media (max-width: 767px) {
    .comparison-table {
        font-size: 14px;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 8px;
    }
}

/* ============================================
   HERO SECTIONS
   ============================================ */

.hero {
    padding: 48px 0;
    text-align: center;
}

@media (min-width: 768px) {
    .hero {
        padding: 80px 0;
    }
}

.hero h1 {
    margin-bottom: 24px;
}

.hero p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted-foreground);
    max-width: 700px;
    margin: 0 auto 32px;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content-section {
    margin: 48px 0;
}

@media (min-width: 768px) {
    .content-section {
        margin: 80px 0;
    }
}

.content-section h2 {
    margin-bottom: 24px;
}

/* ============================================
   PROS & CONS
   ============================================ */

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 32px 0;
}

@media (min-width: 768px) {
    .pros-cons-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pros-box,
.cons-box {
    padding: 24px;
    border-radius: 8px;
}

.pros-box {
    background-color: rgba(34, 211, 238, 0.1);
    border-left: 4px solid var(--accent);
}

.cons-box {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--destructive);
}

.pros-box h3,
.cons-box h3 {
    margin-bottom: 16px;
}

.pros-box ul,
.cons-box ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* ============================================
   WARNING/INFO BOXES
   ============================================ */

.warning-box,
.info-box {
    padding: 20px 24px;
    border-radius: 8px;
    margin: 24px 0;
    border-left: 4px solid;
}

.warning-box {
    background-color: rgba(217, 119, 6, 0.1);
    border-color: #d97706;
}

.info-box {
    background-color: rgba(8, 145, 178, 0.1);
    border-color: var(--accent);
}

.warning-box h3,
.info-box h3 {
    margin-bottom: 12px;
}

/* ============================================
   LEGAL PAGES
   ============================================ */

.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 16px;
}

.legal-page h1 {
    margin-bottom: 16px;
}

.legal-page h2 {
    margin-top: 48px;
    margin-bottom: 16px;
}

.legal-page h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-page p {
    line-height: 1.8;
}

.legal-page ul,
.legal-page ol {
    line-height: 1.8;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.stagger-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

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

.mt-24 {
    margin-top: 24px;
}

.mt-48 {
    margin-top: 48px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-48 {
    margin-bottom: 48px;
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    .hidden-desktop {
        display: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

.dark .card:hover,
.dark .profile-card:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.dark .comparison-table tr:hover {
    background-color: rgba(71, 85, 105, 0.3);
}
