/**
 * Pharma Index Core Platform
 * Global System Stylesheet (styles.css)
 * Theme Style: Pure Minimalist Light, High-Scannability
 * Layout Constraints: Max Width 900px Optimized
 */

/* ==========================================================================
   1. PREMIUM LIGHTWEIGHT DESIGN TOKENS
   ========================================================================== */
:root {
    /* Palette Spectrum */
    --primary: #1e293b;            /* Refined Slate Core Gray */
    --primary-light: #f8fafc;      /* Pure Cloud Panel Canvas */
    --accent: #4f46e5;             /* Modern Electric Indigo Accent */
    --accent-hover: #4338ca;       /* Indigo Transit State */
    --accent-danger: #e11d48;      /* Precise Rose Alert Element */
    --accent-warning: #ea580c;     /* Clean Burnt Amber Accent */
    --success: #15803d;            /* Safe Botanical Green */
    --success-light: #f0fdf4;      /* Soft Mint Canvas Wash */
    --info-bg: #f0f9ff;            /* Clean Azure Diagnostic Canvas */
    --info-text: #0369a1;          /* Pure Healthcare Blue Accent */
    --bg-muted: #f1f5f9;           /* Sophisticated Off-White Foundation */
    --border-color: #e2e8f0;       /* Razor-Thin Whisper Gray lines */
    --text-dark: #334155;          /* Reduced Contrast Dark Charcoal Text */
    --text-muted: #64748b;         /* Technical Slate Secondary Label */
    
    /* Elegant Dimensional Scale */
    --max-width: 900px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Fine Shadow Profiles */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --shadow-hover: 0 20px 25px -5px rgba(79, 70, 229, 0.06), 0 8px 10px -6px rgba(79, 70, 229, 0.04);
}

/* ==========================================================================
   2. TYPE SCALING AND STRUCTURAL RESET
   ========================================================================== */
html {
    box-sizing: border-box;
    font-size: 15px; /* Compact scannability scaling */
    scroll-behavior: smooth;
    background-color: #fafbfc;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--primary);
    font-weight: 600; /* Sophisticated medium weighting */
    letter-spacing: -0.02em;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background-color: var(--bg-muted);
    color: var(--primary);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    border: 1px solid var(--border-color);
}
/* ==========================================================================
   3. SELF-CORRECTING GRIDS & RESPONSIVE COMPACT BOUNDS
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.split-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   4. SYSTEM DESIGN COMPONENTS (BUTTONS & BADGES)
   ========================================================================== */
.badge-ui {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-danger { background-color: #fff1f2; color: var(--accent-danger); border: 1px solid #ffe4e6; }
.badge-warning { background-color: #fff7ed; color: var(--accent-warning); border: 1px solid #ffedd5; }
.badge-success { background-color: var(--success-light); color: var(--success); border: 1px solid #dcfce7; }
.badge-info { background-color: var(--info-bg); color: var(--info-text); border: 1px solid #bae6fd; }

.btn-submit {
    display: inline-block;
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

/* ==========================================================================
   5. LANDING MAIN HUB SPECIFIC INTERFACES (index.php)
   ========================================================================== */
.hero-section {
    background-color: #fff;
    color: var(--text-dark);
    padding: 80px 0 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 2.8rem;
    color: var(--primary);
    margin: 16px 0;
    letter-spacing: -0.03em;
}

.hero-subtext {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.badge {
    background-color: var(--bg-muted);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--border-color);
}

.search-form-wrapper {
    background: #fff;
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    max-width: 680px;
    margin: 0 auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08), var(--shadow-soft);
}

.search-input-group {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding-left: 16px;
    user-select: none;
    pointer-events: none;
}

.search-input-group input[type="text"] {
    width: 100%;
    border: none;
    outline: none;
    padding: 14px 12px;
    font-size: 1.05rem;
    color: var(--primary);
    background: transparent;
}

.system-stats {
    padding: 20px 0 40px 0;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.stat-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 2px 0;
}
/* ==========================================================================
   6. SEARCH RESULTS DASHBOARD ENGINE (search.php)
   ========================================================================== */
.results-header h1 {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.drug-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.drug-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-hover);
}

.indications-box {
    background: var(--primary-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-top: 10px;
}

/* ==========================================================================
   7. DEEP PROFILE ENGINE STYLES (details.php Navigation Fixes)
   ========================================================================== */
.top-navbar {
    background-color: rgba(255, 255, 255, 0.85); /* Frost White Glassmorphism Header */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand h2 {
    font-size: 1.05rem;
    margin: 0;
    color: var(--primary);
}

.top-nav-links {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}

.top-nav-links::-webkit-scrollbar {
    display: none;
}

/* Tab-switching anchors override */
.nav-link, .top-nav-links button {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover, .top-nav-links button:hover {
    background-color: var(--bg-muted);
    color: var(--primary);
}

.nav-link.active, .top-nav-links button.active {
    background-color: #e0e7ff; /* Soft Indigo Link Focus */
    color: var(--accent);
}

/* Core Document Elements Grid */
.main-content {
    max-width: var(--max-width);
    margin: 20px auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.header-banner, .content-section {
    background: #fff;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.content-section {
    scroll-margin-top: 130px; /* Offset alignment tool for frosted header view jumps */
}

.section-title {
    font-size: 1.15rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Document Data Presentation Matrices */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.88rem;
}

table.data-table th {
    background: var(--primary-light);
    text-align: left;
    padding: 12px 10px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

table.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.alert-box {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid #fee2e2;
    background-color: #fff1f2;
    color: #9f1239;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.text-block-scroll {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--primary-light);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Universal Legal Footer Overrides */
footer {
    border-top: 1px solid var(--border-color);
    background: #fff !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    padding: 24px 0 !important;
    margin-top: 40px !important;
}

/* ==========================================================================
   8. RESPONSIVE SCALE MEDIA RULES (900px Viewport Core Breakpoints)
   ========================================================================== */
@media screen and (max-width: 900px) {
    .hero-section h1 { font-size: 2.2rem; }
    .stats-grid { grid-template-columns: 1fr; gap: 14px; }
}

@media screen and (max-width: 640px) {
    .hero-section { padding: 48px 0; }
    .hero-section h1 { font-size: 1.75rem; }
    .content-section, .header-banner { padding: 20px; }
    .nav-brand-row { flex-direction: column; gap: 8px; align-items: flex-start; }
    .btn-submit { width: 100%; }
}
