/* ===== Variables ===== */
:root {
    --color-bg: #0f1419;
    --color-bg-card: #1a2332;
    --color-bg-elevated: #243447;
    --color-text: #e7e9ea;
    --color-text-muted: #8b98a5;
    --color-accent: #00b894;
    --color-accent-hover: #00cec9;
    --color-sativa: #fdcb6e;
    --color-indica: #a29bfe;
    --color-hybrid: #81ecec;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Header & Nav ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ===== Hero ===== */
.hero {
    padding: 4rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: var(--color-text);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Sections ===== */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section-intro {
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

/* ===== Strain Type Cards ===== */
.strain-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.strain-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.strain-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.strain-card.sativa { border-left: 4px solid var(--color-sativa); }
.strain-card.indica { border-left: 4px solid var(--color-indica); }
.strain-card.hybrid { border-left: 4px solid var(--color-hybrid); }

.strain-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.strain-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.strain-card h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 1rem 0 0.5rem;
}

.strain-card ul {
    list-style: none;
}

.strain-card li {
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.strain-card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

.strain-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.strain-card .card-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.strain-card .card-link:hover {
    text-decoration: underline;
}

.science-note {
    background: var(--color-bg-elevated);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.science-note h4 {
    margin-bottom: 0.75rem;
    color: var(--color-accent);
}

.science-note p {
    color: var(--color-text-muted);
}

/* ===== Strain Database ===== */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}
.strain-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-bg-elevated);
    background: var(--color-bg-card);
    color: var(--color-text);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 180px;
}
.strain-search-input:focus { outline: none; border-color: var(--color-accent); }

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-bg-elevated);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
}

.filter-btn.active {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.strain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.strain-item {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s;
}

.strain-item:hover {
    transform: translateY(-2px);
}

.strain-item .type-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Strain type badges - high contrast for easy reading */
.strain-item .type-badge.sativa { background: #e6a800; color: #1a1a1a; }
.strain-item .type-badge.indica { background: #7c6bff; color: #ffffff; }
.strain-item .type-badge.hybrid { background: #00c4c4; color: #1a1a1a; }

.strain-item h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 600;
}

.strain-item p {
    font-size: 0.9rem;
    color: #b8c5d0;
}

/* ===== Medical Section ===== */
.medical-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.medical-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.medical-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--color-accent);
}

.medical-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.disclaimer {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: var(--radius);
    padding: 1rem;
}

.disclaimer p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ===== Videos ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.video-placeholder {
    aspect-ratio: 16/9;
    background: var(--color-bg-elevated);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    gap: 0.5rem;
}

.video-placeholder span {
    font-size: 3rem;
}

.video-placeholder small {
    font-size: 0.8rem;
}

.video-card h3 {
    padding: 1rem;
    font-size: 1rem;
}

.video-embed {
    aspect-ratio: 16/9;
    position: relative;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-search {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.video-search h3 {
    margin-bottom: 0.5rem;
}

.search-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.search-links a {
    padding: 0.5rem 1rem;
    background: var(--color-bg-card);
    color: var(--color-accent);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
}

.search-links a:hover {
    background: var(--color-bg-elevated);
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.strain-status {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ===== Wikipedia / Dynamic Content ===== */
.wikipedia-card {
    display: flex;
    gap: 1.5rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.wikipedia-card .loading {
    color: var(--color-text-muted);
}

.wiki-thumb {
    width: 200px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.wiki-text {
    flex: 1;
}

.wiki-text p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.wiki-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.wiki-link:hover {
    text-decoration: underline;
}

/* ===== Quick Links ===== */
.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.link-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s;
}

.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
}

.link-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.link-card h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.link-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ===== Page-specific: long content ===== */
.page-content {
    max-width: 800px;
}

.page-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-accent);
}

.page-content p, .page-content ul {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.page-content ul {
    padding-left: 1.5rem;
}

.terpene-card, .cannabinoid-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--color-accent);
}

.info-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-card h3 {
    margin-top: 0;
    color: var(--color-accent);
}

.checklist-card .checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.checklist-card .checklist li {
    padding: 0.5rem 0;
    padding-left: 0;
}

.toc {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.toc h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.toc ul { list-style: none; padding: 0; }
.toc li { margin-bottom: 0.35rem; }
.toc a { color: var(--color-accent); font-size: 0.9rem; }
@media print { .toc { display: none; } }

.glossary-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-item h3 {
    margin-top: 0;
    color: var(--color-accent);
    font-size: 1.1rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    margin-top: 0;
    color: var(--color-text);
    font-size: 1rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: var(--color-bg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 1rem;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.breadcrumbs a {
    color: var(--color-accent);
    text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }

/* ===== Search ===== */
.search-form-hero {
    max-width: 500px;
    margin: 1.5rem auto 0;
    display: flex;
    gap: 0.5rem;
}
.search-input-hero {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-bg-elevated);
    border-radius: 8px;
    background: var(--color-bg-card);
    color: var(--color-text);
    font-size: 1rem;
}
.search-input-hero:focus {
    outline: none;
    border-color: var(--color-accent);
}
.search-btn {
    padding: 0.75rem 1.25rem;
    background: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.search-btn:hover { opacity: 0.9; }
.search-list { list-style: none; padding: 0; }
.search-list li { margin-bottom: 0.5rem; }
.search-list a { color: var(--color-accent); }
.search-placeholder, .search-no-results { color: var(--color-text-muted); }

/* ===== Calculator ===== */
.calculator-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    max-width: 500px;
}
.calculator-form label {
    display: block;
    margin-bottom: 1rem;
}
.calculator-form label span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.calculator-form input {
    width: 100%;
    padding: 0.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--color-text);
}
.dose-result { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.dose-warning { color: #fdcb6e; margin-top: 0.5rem; }
.dose-guide { max-width: 500px; }

/* ===== Compare ===== */
.compare-select {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-end;
}
.compare-select label { display: flex; flex-direction: column; gap: 0.25rem; }
.compare-select input {
    padding: 0.5rem;
    min-width: 150px;
    background: var(--color-bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--color-text);
}
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.compare-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.compare-card h3 { margin-bottom: 0.75rem; }
.compare-card p { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.compare-card a { color: var(--color-accent); }

/* ===== Safety ===== */
.safety-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-accent);
}
.safety-card.warning { border-left-color: #fdcb6e; }

/* ===== Legal Table ===== */
.legal-table-wrap { overflow-x: auto; margin: 1rem 0; }
.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.legal-table th, .legal-table td {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: left;
}
.legal-table th { background: var(--color-bg-elevated); font-weight: 600; }
.legal-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-bg-elevated);
    color: var(--color-text-muted);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}
.theme-toggle:hover { color: var(--color-text); }

.print-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.print-btn:hover { background: var(--color-accent-hover); }

/* ===== Light Mode ===== */
body.light-mode {
    --color-bg: #f5f5f5;
    --color-bg-card: #ffffff;
    --color-bg-elevated: #e8e8e8;
    --color-text: #1a1a1a;
    --color-text-muted: #555;
}
body.light-mode header { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.08); }
body.light-mode .strain-item h4 { color: #1a1a1a; }
body.light-mode .strain-item p { color: #555; }

/* ===== Favorites ===== */
.fav-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
}
.fav-btn:hover, .fav-btn.favorited { opacity: 1; }
.fav-btn.favorited { color: #e74c3c; }
.strain-item { position: relative; }

/* ===== Strain of the Day ===== */
.strain-of-day-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0,184,148,0.15);
}
.strain-of-day-card h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.strain-of-day-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 1.15rem;
}
.strain-of-day-link:hover { text-decoration: underline; }
.strain-of-day-card p { margin-top: 0.75rem; color: var(--color-text-muted); font-size: 0.9rem; }
.strain-of-day-card p a { color: var(--color-accent); }

/* ===== Related Pages & Share ===== */
.related-pages { border-top: 1px solid rgba(255,255,255,0.06); }
.related-pages h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.related-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.related-links a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}
.related-links a:hover { text-decoration: underline; }
.share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.share-label { color: var(--color-text-muted); font-size: 0.9rem; }
.share-bar a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
}
.share-bar a:hover { text-decoration: underline; }
footer .last-updated { color: var(--color-text-muted); font-size: 0.85rem; }

/* ===== Loading Skeleton ===== */
.strain-skeleton { height: 140px !important; }
.loading.skeleton {
    display: block;
    height: 120px;
    background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-bg-card) 50%, var(--color-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Loading & Error ===== */
.loading { color: var(--color-text-muted); }
.related-strains { margin-top: 2rem; }
.related-strains h3 { margin-bottom: 1rem; }

.error-msg {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    color: #e74c3c;
}

/* ===== Print ===== */
@media print {
    header, footer, .nav, .breadcrumbs, .theme-toggle, .fav-btn, .skip-link, .filters, .search-form-hero, .no-print, .share-bar, .back-to-top, .print-btn { display: none !important; }
    body { background: white; color: #000; }
    a { color: #0066cc; }
    .section { padding: 1rem 0; }
    .hero { padding: 1rem 0; }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 1rem;
    }

    .section {
        padding: 3rem 1rem;
    }
}
