/*
Theme Name: Flavor
Theme URI: https://sgkoduyormu.com
Author: SGK Oduyormu
Description: Modern, fast, ad-optimized medicine information theme
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: flavor
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #059669;
    --success-light: #d1fae5;
    --success-dark: #047857;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --bg: #f8fafc;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e3a5f;
    --success-light: #064e3b;
    --danger-light: #7f1d1d;
    --bg: #0f172a;
    --card: #1e293b;
    --white: #1e293b;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

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

/* HEADER */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.search-form {
    display: flex;
    flex: 1;
    max-width: 500px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--gray-800);
    outline: none;
}

.search-form button {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover { background: var(--primary-hover); }

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-menu a {
    padding: 8px 16px;
    color: var(--gray-600);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-menu a:hover { background: var(--gray-100); color: var(--primary); }

/* BREADCRUMB */
.breadcrumb {
    background: var(--white);
    padding: 12px 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}

.breadcrumb a { color: var(--gray-500); }
.breadcrumb span { color: var(--gray-400); }

/* MAIN */
main { padding: 24px 0; min-height: 60vh; }

/* CARDS */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: all 0.25s;
    margin-bottom: 16px;
}

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

.card a { display: block; color: inherit; }

.card-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

.status-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.inactive {
    background: var(--danger-light);
    color: var(--danger);
}

.card-body {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item span {
    font-weight: 500;
    color: var(--gray-700);
}

/* SINGLE PAGE */
.medicine-article { margin-bottom: 24px; }

.medicine-article .card-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--gray-50), var(--white));
}

.medicine-article .card-title { font-size: 1.5rem; }

.status-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px;
}

.status-box.covered {
    background: linear-gradient(135deg, var(--success-light), rgba(5,150,105,0.05));
    border: 1px solid rgba(5,150,105,0.2);
}

.status-box.not-covered {
    background: linear-gradient(135deg, var(--danger-light), rgba(220,38,38,0.05));
    border: 1px solid rgba(220,38,38,0.2);
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.covered .status-icon { background: var(--success); }
.not-covered .status-icon { background: var(--danger); }

.status-text h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.covered .status-text h3 { color: var(--success-dark); }
.not-covered .status-text h3 { color: var(--danger); }

.info-section {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
}

.info-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: inline-block;
}

.info-section p { margin-bottom: 8px; }

.medicine-content {
    line-height: 1.8;
    color: var(--gray-700);
}

.medicine-content p { margin-bottom: 16px; }

/* FAQ */
.faq-section {
    padding: 20px;
    background: var(--gray-50);
}

.faq-item {
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    padding: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover { background: var(--gray-50); }
.faq-question::after { content: "+"; font-size: 1.25rem; color: var(--gray-400); }
.faq-item.active .faq-question::after { content: "-"; }

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

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 16px 16px;
}

/* BUTTONS */
.btn-group {
    padding: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover { background: var(--gray-200); }

/* ADS */
.ad-container {
    margin: 20px 0;
    text-align: center;
    min-height: 100px;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-weight: 500;
    color: var(--gray-600);
}

.pagination a:hover { background: var(--gray-100); }
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* FOOTER */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 32px 0;
    margin-top: 32px;
    text-align: center;
}

.site-footer p { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 8px; }
.disclaimer { color: var(--gray-400); font-size: 0.8rem; font-style: italic; }

/* DARK MODE TOGGLE */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.theme-toggle:hover { transform: scale(1.1); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .search-form { max-width: 100%; }
    .nav-menu { justify-content: center; }
    .card-body { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; }
    .status-box { flex-direction: column; text-align: center; }
}

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

/* AD CONTAINER STYLES */
.ad-container {
    margin: 20px 0;
    min-height: 100px;
    text-align: center;
    overflow: hidden;
}

.ad-above-fold {
    margin: 15px 0 20px 0;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.ad-mid-content {
    margin: 25px 0;
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
}

.ad-pre-faq {
    margin: 20px 0;
}

.ad-post-social {
    margin: 25px 0;
}

.ad-multiplex {
    margin: 30px 0 20px 0;
    padding: 15px 0;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.ad-in-feed {
    margin: 15px 0;
}

.ad-mid-list {
    margin: 15px 0;
}

.ad-bottom-multiplex {
    margin: 30px 0 20px 0;
}

/* Mobile ad adjustments */
@media (max-width: 768px) {
    .ad-container {
        margin: 15px -10px;
        padding: 0 10px;
    }

    .ad-above-fold {
        margin: 10px -10px 15px -10px;
        padding: 10px;
        border-radius: 0;
    }

    .ad-multiplex,
    .ad-bottom-multiplex {
        margin: 20px -10px;
        padding: 10px;
        border-radius: 0;
    }
}

/* Dark mode ad backgrounds */
[data-theme="dark"] .ad-above-fold,
[data-theme="dark"] .ad-multiplex {
    background: var(--gray-800);
}

[data-theme="dark"] .ad-mid-content {
    border-color: var(--gray-700);
}

/* PRINT */
@media print {
    .site-header, .site-footer, .ad-container, .theme-toggle { display: none !important; }
}
