/* Period Tracker - Website Styles */
/* Aligned with iOS app branding - Verde salvia & rosa cipria */

/* Google Fonts - Fraunces for headings */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

:root {
    /* Colors - iOS App aligned palette */
    --primary-color: #8FA584;        /* Verde salvia */
    --primary-light: #B5C4AD;
    --primary-dark: #6B7F62;
    --accent-color: #F5E1DC;         /* Rosa cipria */
    --accent-dark: #E8C9C1;

    /* Neutrals */
    --bg-color: #FDF9F6;             /* Crema caldo */
    --bg-card: #FFFFFF;
    --text-primary: #3D4A38;
    --text-secondary: #6B7F62;
    --text-muted: #8A9A7F;
    --border-color: #E8E2DC;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-heading: 'Fraunces', Georgia, serif;
    --font-size-base: 16px;
    --line-height: 1.7;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(143, 165, 132, 0.08);
    --shadow-md: 0 4px 16px rgba(143, 165, 132, 0.12);
    --shadow-lg: 0 8px 32px rgba(143, 165, 132, 0.16);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #A8BF9C;
        --primary-light: #8FA584;
        --primary-dark: #C5D4BC;
        --accent-color: #4A3F3C;
        --accent-dark: #5C4E4A;

        --bg-color: #1C1F1A;
        --bg-card: #282C26;
        --text-primary: #E8EDE5;
        --text-secondary: #B5C4AD;
        --text-muted: #8A9A7F;
        --border-color: #3D4A38;

        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-color);
    min-height: 100vh;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

a:focus:not(:focus-visible) {
    outline: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary-dark);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--primary-dark);
    margin-top: var(--spacing-lg);
}

h3 {
    font-size: clamp(1.125rem, 3vw, 1.375rem);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    max-width: 65ch;
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header / Hero Section */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.header-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

.header h1 {
    color: white;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.125rem;
    margin-top: var(--spacing-xs);
    font-weight: 400;
    max-width: none;
    text-align: center;
}

/* Privacy Badge */
.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.privacy-badge svg {
    width: 16px;
    height: 16px;
}

.app-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Hero Grid Layout */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .hero-grid .hero-content {
        order: 1;
    }

    .hero-grid .hero-image {
        order: 2;
    }
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
}

/* Navigation */
.nav {
    background: var(--bg-card);
    padding: var(--spacing-sm) var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    list-style: none;
}

.nav-links a {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: background-color 0.3s ease, color 0.3s ease;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus {
    background-color: var(--accent-color);
    color: var(--primary-dark);
    text-decoration: none;
}

/* Language Selector */
.lang-selector {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    z-index: 101;
}

.lang-selector select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-selector select:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    background: var(--bg-card);
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 900px;
    animation: fadeIn 0.4s ease-out;
}

/* Social Proof Section */
.social-proof {
    background: var(--accent-color);
    padding: var(--spacing-lg) var(--spacing-md);
    margin: 0;
}

.social-proof-inner {
    max-width: 900px;
    margin: 0 auto;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-width: 140px;
    text-align: center;
}

.trust-badge-icon {
    font-size: 1.5rem;
}

.trust-badge-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.trust-badge-value {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-highlight {
    background: linear-gradient(135deg, var(--accent-color), #F9EDE9);
    border-left-color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
    .card-highlight {
        background: linear-gradient(135deg, var(--accent-color), #3D3532);
    }
}

/* Lists */
ul, ol {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

/* Info boxes */
.info-box {
    background: linear-gradient(135deg, #E8F4E5, #D4E8CF);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-left: 4px solid var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    .info-box {
        background: linear-gradient(135deg, #2A3328, #252D24);
    }
}

.warning-box {
    background: linear-gradient(135deg, #FFF8E6, #FFECB3);
    border-left-color: #E6A700;
}

@media (prefers-color-scheme: dark) {
    .warning-box {
        background: linear-gradient(135deg, #3D3525, #352D1F);
        border-left-color: #F5B800;
    }
}

.success-box {
    background: linear-gradient(135deg, #E8F4E5, #D4E8CF);
    border-left-color: var(--primary-color);
}

@media (prefers-color-scheme: dark) {
    .success-box {
        background: linear-gradient(135deg, #2A3328, #252D24);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: var(--bg-card);
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: none;
}

.footer-links {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-dark);
    outline-offset: 3px;
}

.btn-secondary {
    background: var(--accent-color);
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background: var(--accent-dark);
    color: var(--primary-dark);
}

/* App Store Badge */
.app-store-badge {
    height: 50px;
    margin-top: var(--spacing-md);
    transition: transform 0.2s ease;
}

.app-store-badge:hover {
    transform: scale(1.05);
}

/* Section Divider */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: var(--spacing-lg) 0;
}

/* Effective Date */
.effective-date {
    background: var(--accent-color);
    color: var(--primary-dark);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: var(--spacing-md);
}

/* Table of Contents */
.toc {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.toc h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary-dark);
}

.toc ol {
    counter-reset: toc-counter;
    list-style: none;
    padding-left: 0;
}

.toc li {
    counter-increment: toc-counter;
    margin-bottom: var(--spacing-xs);
}

.toc li::before {
    content: counter(toc-counter) ". ";
    color: var(--primary-color);
    font-weight: 600;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.features-grid .card {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-base: 15px;
    }

    .header {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .main-content {
        margin: var(--spacing-sm);
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .nav-links {
        gap: var(--spacing-sm);
    }

    .lang-selector {
        position: static;
        text-align: center;
        margin-bottom: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .lang-selector select {
        background: var(--bg-card);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    .trust-badges {
        gap: var(--spacing-sm);
    }

    .trust-badge {
        min-width: 120px;
        padding: var(--spacing-sm);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .header {
        background: var(--primary-light);
        color: var(--text-primary);
    }

    .header h1 {
        color: var(--text-primary);
    }

    .nav, .lang-selector, .social-proof {
        display: none;
    }

    .main-content {
        box-shadow: none;
        margin: 0;
    }

    .card {
        break-inside: avoid;
    }
}
