/*
 * Hypothyroidism Safe - Main Stylesheet
 * Mobile-first, SEO-friendly, clean design
 */

/* CSS Variables */
:root {
    --primary-color: #2c5282;
    --primary-dark: #1a365d;
    --secondary-color: #38a169;
    --accent-color: #ed8936;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #ffffff;
    --bg-light: #f7fafc;
    --bg-dark: #edf2f7;
    --border-color: #e2e8f0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 8px;
    --max-width: 1200px;
}

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

/* Base Styles */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

img {
    max-width: 100%;
    height: auto;
}

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

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

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo:hover {
    text-decoration: none;
    color: var(--primary-dark);
}

.nav-links {
    display: none;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

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

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: 0.3s;
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card h2, .card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

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

.card-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
}

/* News Items */
.news-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.news-item h3 a {
    color: var(--text-color);
}

.news-item h3 a:hover {
    color: var(--primary-color);
}

.news-source {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Article Content */
.article-content {
    max-width: 800px;
}

.article-content h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin: 2rem 0 1rem;
}

.article-content h3 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1rem 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Supplements */
.supplement-card {
    background: var(--bg-light);
    border-left: 4px solid var(--secondary-color);
}

.supplement-card h3 {
    color: var(--secondary-color);
}

.supplement-benefits {
    list-style: none;
    margin: 1rem 0;
}

.supplement-benefits li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.supplement-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Disclaimer Box */
.disclaimer-box {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-left: 4px solid #e53e3e;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.disclaimer-box h3 {
    color: #c53030;
    margin-bottom: 0.5rem;
}

.disclaimer-box p {
    color: #742a2a;
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.medical-disclaimer {
    background: #fffaf0;
    border: 1px solid #fbd38d;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.medical-disclaimer h4 {
    color: #c05621;
    margin-bottom: 0.75rem;
}

.medical-disclaimer p {
    font-size: 0.9rem;
    color: #744210;
    margin-bottom: 0.5rem;
}

.medical-disclaimer p:last-child {
    margin-bottom: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: #2f855a;
    color: white;
    text-decoration: none;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

/* Admin Styles */
.admin-header {
    background: var(--primary-dark);
    color: white;
    padding: 1rem;
    margin: -2rem -1rem 2rem;
}

.admin-header h1 {
    font-size: 1.25rem;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.admin-nav a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.admin-nav a:hover {
    color: white;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.data-table tr:hover {
    background: var(--bg-light);
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
}

/* Responsive Design */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .hero {
        padding: 4rem 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .page-header h1 {
        font-size: 2.5rem;
    }
}

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

/* Mobile Menu Active State */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .mobile-menu-toggle {
        display: none;
    }

    .site-main {
        padding: 0;
    }
}
