/* MedicLog Website Styles */
/* Light mode by default, dark mode for prefers-color-scheme: dark */

:root {
    /* Light mode colors (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-tertiary: #e8ecf1;
    --text-primary: #1a2332;
    --text-secondary: #455a64;
    --text-muted: #607d8b;
    --accent: #2196f3;
    --accent-hover: #1976d2;
    --border: #d0d7de;
    --border-light: #e8ecf1;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --highlight-bg: rgba(33, 150, 243, 0.08);
    --highlight-border: rgba(33, 150, 243, 0.25);
    --code-bg: #f5f7fa;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0e1a;
        --bg-secondary: rgba(255, 255, 255, 0.03);
        --bg-tertiary: rgba(255, 255, 255, 0.05);
        --text-primary: #e8ecf1;
        --text-secondary: #b0bec5;
        --text-muted: #90a4ae;
        --accent: #2196f3;
        --accent-hover: #42a5f5;
        --border: #2a3a4a;
        --border-light: #1a2332;
        --nav-bg: rgba(10, 14, 26, 0.95);
        --card-bg: rgba(255, 255, 255, 0.03);
        --highlight-bg: rgba(33, 150, 243, 0.1);
        --highlight-border: rgba(33, 150, 243, 0.3);
        --code-bg: rgba(0, 0, 0, 0.3);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

@media (max-width: 640px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
    }

    .nav-links.open {
        display: flex;
    }
}

/* Nav dropdowns */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted) !important;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    line-height: inherit;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
    color: var(--text-primary) !important;
}

.nav-dropdown-chevron {
    font-size: 0.6rem;
    transition: transform 0.2s;
    opacity: 0.5;
    margin-top: 1px;
}

.nav-dropdown:hover .nav-dropdown-chevron,
.nav-dropdown.open .nav-dropdown-chevron {
    transform: rotate(180deg);
    opacity: 0.8;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nav-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.4rem;
    padding-top: 0.85rem;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

@media (max-width: 640px) {
    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--border);
        border-radius: 0;
        padding: 0.25rem 0 0.25rem 0.75rem;
        margin-left: 0.25rem;
        background: transparent;
        backdrop-filter: none;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }
}

/* Main content container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.container-wide {
    max-width: 960px;
}

/* Page header */
.page-header {
    margin-bottom: 3rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.page-header .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* Section styling */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.section ul {
    list-style: none;
    margin-bottom: 1rem;
}

.section li {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Feature cards */
.feature-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

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

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.feature-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* FAQ accordion */
.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
    content: '-';
}

.faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-item.open .faq-answer {
    display: block;
}

/* Tutorial steps */
.tutorial-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.step-content h3 {
    margin-bottom: 0.5rem;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0;
}

.step-screenshot {
    flex-shrink: 0;
    width: 130px;
    border-radius: 10px;
    align-self: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
    .tutorial-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .step-screenshot {
        width: 100%;
        max-width: 200px;
        align-self: center;
    }
}

/* Screenshots grid */
.screenshot-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.screenshot-group {
    margin-bottom: 2rem;
}

.screenshot-group h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.screenshot-placeholder {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.screenshot-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Privacy/Legal sections */
.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.75rem;
    color: var(--text-primary);
}

.legal-section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.legal-section ul {
    list-style: none;
    margin-bottom: 1rem;
}

.legal-section li {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.legal-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.legal-section li strong {
    color: var(--text-primary);
}

.highlight-box {
    background: var(--highlight-bg);
    border: 1px solid var(--highlight-border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.highlight-box p {
    margin: 0;
    color: var(--text-secondary);
}

.highlight-box strong {
    color: var(--text-primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

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

.btn-outline:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Utility classes */
.text-center {
    text-align: center;
}

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

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.screenshot-gallery.hero {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 700px;
    margin: 2rem auto;
}

.screenshot-gallery.features {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.screenshot-gallery.devices {
    grid-template-columns: repeat(3, 1fr);
    max-width: 800px;
    margin: 2rem auto;
}

@media (max-width: 640px) {
    .screenshot-gallery.devices {
        grid-template-columns: 1fr;
    }
}

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

.screenshot-item img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
}

.screenshot-item.phone img {
    max-width: 280px;
}

.screenshot-item.watch img {
    max-width: 180px;
    border-radius: 42px;
    border: 10px solid #1a1a1a;
    box-shadow:
        0 0 0 3px #333,
        0 8px 24px rgba(0, 0, 0, 0.4);
}

.screenshot-item.tablet img {
    max-width: 400px;
}

.screenshot-caption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Light/Dark mode comparison */
.screenshot-compare {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: nowrap;
    margin: 2rem 0;
    align-items: flex-end;
}

@media (max-width: 900px) {
    .screenshot-compare {
        flex-wrap: wrap;
    }
}

.screenshot-compare .screenshot-item {
    flex: 0 0 auto;
}

.screenshot-compare .screenshot-item img {
    max-width: 100%;
}

/* Device frames override - don't apply default screenshot styling */
.screenshot-item .device-frame-iphone img,
.screenshot-item .device-frame-watch img,
.screenshot-item .device-frame-ipad img {
    border: none;
    box-shadow: none;
}

/* Device showcase row */
.device-showcase {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.device-showcase .screenshot-item.phone img {
    max-width: 220px;
}

.device-showcase .screenshot-item.watch img {
    max-width: 140px;
}

.device-showcase .screenshot-item.tablet img {
    max-width: 320px;
}

/* Device Frames - CSS-only bezels for screenshots */

/* iPhone frame */
.device-frame-iphone {
    position: relative;
    display: inline-block;
    padding: 12px 10px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 40px;
    box-shadow:
        inset 0 0 0 2px #3a3a3a,
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.device-frame-iphone::before {
    /* Notch/Dynamic Island */
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 14px;
    z-index: 10;
}

.device-frame-iphone img {
    display: block;
    border-radius: 32px;
    max-width: 100%;
    height: auto;
}

/* Watch frame - circular bezel */
.device-frame-watch {
    position: relative;
    display: inline-block;
    padding: 8px;
    background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
    border-radius: 28%;
    box-shadow:
        inset 0 0 0 2px #4a4a4a,
        0 0 0 3px #2a2a2a,
        0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Inner screen area — clips image to the watch's rounded rectangle
   without clipping the ::before/::after crown and button decorations */
.device-frame-watch .watch-screen {
    overflow: hidden;
    border-radius: 21%;
    line-height: 0;
}

.device-frame-watch::before {
    /* Digital Crown */
    content: '';
    position: absolute;
    right: -6px;
    top: 35%;
    width: 6px;
    height: 20px;
    background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
    border-radius: 2px;
}

.device-frame-watch::after {
    /* Side button */
    content: '';
    position: absolute;
    right: -5px;
    top: calc(35% + 28px);
    width: 5px;
    height: 14px;
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    border-radius: 2px;
}

.device-frame-watch img {
    display: block;
    border-radius: 22%;
    max-width: 100%;
    height: auto;
}

/* iPad frame */
.device-frame-ipad {
    position: relative;
    display: inline-block;
    padding: 14px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 24px;
    box-shadow:
        inset 0 0 0 2px #3a3a3a,
        0 8px 32px rgba(0, 0, 0, 0.35);
}

.device-frame-ipad img {
    display: block;
    border-radius: 12px;
    max-width: 100%;
    height: auto;
}

/* Light mode adjustments - slightly softer shadows */
@media (prefers-color-scheme: light) {
    .device-frame-iphone,
    .device-frame-watch,
    .device-frame-ipad {
        box-shadow:
            inset 0 0 0 2px #4a4a4a,
            0 4px 20px rgba(0, 0, 0, 0.2),
            0 1px 4px rgba(0, 0, 0, 0.15);
    }
}

/* Sizing for device frames in hero section */
.screenshot-compare .device-frame-iphone {
    max-width: 280px;
}

.screenshot-compare .device-frame-watch {
    max-width: 180px;
}

/* Ensure order is preserved on wrap */
.screenshot-compare .screenshot-item:nth-child(1) { order: 1; }
.screenshot-compare .screenshot-item:nth-child(2) { order: 2; }
.screenshot-compare .screenshot-item:nth-child(3) { order: 3; }

/* Feature rows - screenshot left, description right */
.feature-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-screenshot {
    flex: 0 0 280px;
    text-align: center;
}

/* When feature-row has multiple screenshots (gallery mode), allow wrapping and shrinking */
.feature-row:has(.feature-screenshot:nth-child(3)) {
    flex-wrap: wrap;
    justify-content: center;
}

.feature-row:has(.feature-screenshot:nth-child(3)) .feature-screenshot {
    flex: 0 1 200px;
    min-width: 150px;
}

.feature-row:has(.feature-screenshot:nth-child(3)) .device-frame-iphone {
    max-width: 180px;
}

.feature-screenshot img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Device frames handle their own styling - don't add extra shadows */
.feature-screenshot .device-frame-iphone img,
.feature-screenshot .device-frame-watch img,
.feature-screenshot .device-frame-ipad img {
    box-shadow: none;
}

/* Watch frames in feature rows and timer state strips — constrain to 180px
   so they match the cross-layout home/QA frame size. */
.feature-screenshot .device-frame-watch,
.timer-state-item .device-frame-watch {
    width: 180px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.feature-screenshot .device-frame-watch img,
.timer-state-item .device-frame-watch img {
    width: 100%;
    height: auto;
}

.feature-screenshot.watch img {
    max-width: 180px;
    border-radius: 42px;
    border: 10px solid #1a1a1a;
    box-shadow:
        0 0 0 3px #333,
        0 8px 24px rgba(0, 0, 0, 0.4);
}

.feature-screenshot.tablet img {
    max-width: 100%;
    max-height: 400px;
}

.feature-description {
    flex: 1;
}

.feature-description h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.feature-description p {
    margin: 0.5rem 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.feature-description p:last-child {
    margin-bottom: 0;
}

/* Responsive - stack on mobile */
@media (max-width: 768px) {
    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
    }

    .feature-screenshot {
        flex: 0 0 auto;
        max-width: 280px;
    }
}
