/* ===== CSS Variables ===== */
:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fee2e2;
    --secondary: #1e40af;
    --secondary-light: #3b82f6;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;
    --gradient-1: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-2: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    /* Theme specific */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --border-color: rgba(255,255,255,0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --header-bg: rgba(15, 23, 42, 0.8);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --header-bg: rgba(255, 255, 255, 0.98);
    --gradient-bg: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ===== Light Theme Overrides ===== */
[data-theme="light"] body {
    background: #f1f5f9;
    background-image: 
        radial-gradient(ellipse 100% 80% at 0% 0%, rgba(220, 38, 38, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 50% 30%, rgba(139, 92, 246, 0.03) 0%, transparent 40%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e5e7eb 100%);
    background-attachment: fixed;
}
[data-theme="light"] .animated-bg {
    display: block;
    background: none;
}
[data-theme="light"] .floating-shape {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(249, 115, 22, 0.05) 100%);
    opacity: 0.5;
    animation-duration: 30s;
}
[data-theme="light"] .floating-shape.shape-2 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
}
[data-theme="light"] .floating-shape.shape-3 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.03) 100%);
}
[data-theme="light"] .floating-shape.shape-4 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(249, 115, 22, 0.03) 100%);
}
[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
[data-theme="light"] .hero-title {
    color: var(--text-primary);
}
[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
[data-theme="light"] .hero-badge {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
[data-theme="light"] .hero-description {
    color: var(--text-secondary);
}
[data-theme="light"] .search-box {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
[data-theme="light"] .search-box:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
[data-theme="light"] .search-input {
    color: var(--text-primary);
}
[data-theme="light"] .search-input::placeholder {
    color: #94a3b8;
}
[data-theme="light"] .stat-number {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
[data-theme="light"] .stat-label {
    color: var(--text-secondary);
}
[data-theme="light"] .stat-divider {
    background: #e2e8f0;
}
[data-theme="light"] .quick-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: var(--text-secondary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
[data-theme="light"] .quick-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
[data-theme="light"] .nav-link {
    color: var(--text-secondary);
}
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    color: var(--text-primary);
    background: #f1f5f9;
}
[data-theme="light"] .section-tag {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
[data-theme="light"] .section-title {
    color: var(--text-primary);
}
[data-theme="light"] .section-description {
    color: var(--text-secondary);
}
[data-theme="light"] .main-category-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
[data-theme="light"] .main-category-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #fecaca;
}
[data-theme="light"] .main-category-info h3 {
    color: var(--text-primary);
}
[data-theme="light"] .main-category-info p {
    color: var(--text-secondary);
}
[data-theme="light"] .main-category-arrow {
    background: #f1f5f9;
    color: var(--text-secondary);
}
[data-theme="light"] .category-card {
    background: #ffffff;
    border-color: #e2e8f0;
    color: var(--text-secondary);
}
[data-theme="light"] .category-card:hover,
[data-theme="light"] .category-card.active {
    background: #fef2f2;
    border-color: #dc2626;
    color: var(--text-primary);
}
[data-theme="light"] .category-icon {
    background: #f1f5f9;
}
[data-theme="light"] .protocol-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
[data-theme="light"] .protocol-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: #fecaca;
}
[data-theme="light"] .protocol-title {
    color: var(--text-primary);
}
[data-theme="light"] .protocol-category {
    color: var(--text-secondary);
}
[data-theme="light"] .protocol-description {
    color: var(--text-secondary);
}
[data-theme="light"] .protocol-icon {
    background: #fef2f2;
}
[data-theme="light"] .protocol-tag {
    background: #f1f5f9;
    color: var(--text-secondary);
}
[data-theme="light"] .favorite-btn {
    background: #f1f5f9;
    color: var(--text-secondary);
}
[data-theme="light"] .favorite-btn:hover,
[data-theme="light"] .favorite-btn.active {
    background: #fef3c7;
    color: #f59e0b;
}
[data-theme="light"] .about-section {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}
[data-theme="light"] .about-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.1);
}
[data-theme="light"] .about-card h3,
[data-theme="light"] .about-card span {
    color: #991b1b;
}
[data-theme="light"] .emergency-number {
    color: #dc2626;
}
[data-theme="light"] .about-card-icon {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}
[data-theme="light"] .about-text p {
    color: var(--text-secondary);
}
[data-theme="light"] .feature-item {
    color: var(--text-primary);
}
[data-theme="light"] .footer {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .footer-brand p,
[data-theme="light"] .footer-links a,
[data-theme="light"] .footer-contact p {
    color: var(--text-secondary);
}
[data-theme="light"] .footer-links h4,
[data-theme="light"] .footer-contact h4 {
    color: var(--text-primary);
}
[data-theme="light"] .footer-bottom {
    border-color: #e2e8f0;
    color: var(--text-secondary);
}
[data-theme="light"] .modal-overlay {
    background: rgba(0,0,0,0.5);
}
[data-theme="light"] .modal-content {
    background: #ffffff;
}
[data-theme="light"] .modal-header {
    border-color: #e2e8f0;
}
[data-theme="light"] .modal-header h3 {
    color: var(--text-primary);
}
[data-theme="light"] .newtab-btn {
    background: #f1f5f9;
    color: var(--text-primary);
}
[data-theme="light"] .close-btn {
    background: #f1f5f9;
    color: var(--text-secondary);
}
[data-theme="light"] .search-suggestions {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
[data-theme="light"] .suggestion-item {
    color: var(--text-primary);
}
[data-theme="light"] .suggestion-item:hover {
    background: #f8fafc;
}
[data-theme="light"] .toast {
    background: #ffffff;
    border-color: #e2e8f0;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
[data-theme="light"] .scroll-top-btn {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}
[data-theme="light"] .no-results h3 {
    color: var(--text-primary);
}
[data-theme="light"] .no-results p {
    color: var(--text-secondary);
}
[data-theme="light"] .no-results-icon {
    background: #f1f5f9;
    color: var(--text-secondary);
}
[data-theme="light"] .logo-subtitle {
    color: var(--text-secondary);
}
[data-theme="light"] .mobile-menu {
    background: #ffffff;
}
[data-theme="light"] .mobile-nav a {
    color: var(--text-primary);
    border-color: #e2e8f0;
}
[data-theme="light"] .mobile-nav-special {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
}
[data-theme="light"] .mobile-menu-close {
    color: var(--text-secondary);
}
[data-theme="light"] .pdf-loading {
    background: #ffffff;
}
[data-theme="light"] .pdf-loading p {
    color: var(--text-secondary);
}
[data-theme="light"] .pdf-loading-spinner {
    border-color: #e2e8f0;
    border-top-color: #dc2626;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-left: 1px solid rgba(255,255,255,0.05);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    background-clip: padding-box;
}

/* Scrollbar with heartbeat pulse effect */
@keyframes scrollbar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
::-webkit-scrollbar-thumb {
    animation: scrollbar-pulse 2s ease-in-out infinite;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #1e293b;
}

/* Light Theme Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-left: 1px solid rgba(0,0,0,0.05);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 50%, #b91c1c 100%);
    border: 2px solid #f1f5f9;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
}
[data-theme="light"] * {
    scrollbar-color: #dc2626 #f1f5f9;
}
body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ===== Info Ticker ===== */
.info-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: var(--gradient-1);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.ticker-content {
    display: flex;
    animation: ticker-scroll 30s linear infinite;
    white-space: nowrap;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 40px;
    font-size: 13px;
    font-weight: 500;
    color: white;
}
.ticker-item i {
    font-size: 12px;
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
[data-theme="light"] .info-ticker {
    background: linear-gradient(90deg, #dc2626 0%, #ea580c 50%, #dc2626 100%);
}

/* Header position */
.header {
    top: 0 !important;
}
.hero {
    padding-top: 120px !important;
}

/* ===== Recently Viewed Section ===== */
.recent-section {
    padding: 30px 0;
    position: relative;
    z-index: 1;
    display: none;
}
.recent-section.show {
    display: block;
}
.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.recent-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}
.recent-title i {
    color: var(--primary);
}
.clear-recent-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--gray-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}
.clear-recent-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}
.recent-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.recent-grid::-webkit-scrollbar {
    display: none;
}
.recent-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}
.recent-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.recent-item-icon {
    width: 36px;
    height: 36px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
}
.recent-item-info {
    flex: 1;
    min-width: 0;
}
.recent-item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.recent-item-type {
    font-size: 11px;
    color: var(--text-secondary);
}
[data-theme="light"] .recent-item {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
[data-theme="light"] .clear-recent-btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* ===== Search Shortcut Badge ===== */
.search-shortcut {
    display: none;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-light);
    margin-right: 8px;
}
@media (min-width: 768px) {
    .search-shortcut {
        display: block;
    }
}
[data-theme="light"] .search-shortcut {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--gray-light);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    color: #fbbf24;
    transform: rotate(20deg);
}
[data-theme="light"] .theme-toggle {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}
[data-theme="light"] .theme-toggle:hover {
    background: #fef3c7;
    color: #f59e0b;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0a0f1a 0%, #1a1f2e 50%, #0a0f1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.loading-content { 
    text-align: center;
    position: relative;
}

/* Heartbeat Container */
.loading-heart-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
}

/* ECG Line behind heart */
.ecg-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 60px;
    overflow: hidden;
}
.ecg-line svg {
    width: 400px;
    height: 60px;
    animation: ecg-scroll 2s linear infinite;
}
.ecg-line svg path {
    fill: none;
    stroke: rgba(220, 38, 38, 0.3);
    stroke-width: 2;
}
@keyframes ecg-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

/* Beating Heart */
.loading-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 70px;
    color: #dc2626;
    animation: heartbeat 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.5));
}
@keyframes heartbeat {
    0% { transform: translate(-50%, -50%) scale(1); }
    14% { transform: translate(-50%, -50%) scale(1.2); }
    28% { transform: translate(-50%, -50%) scale(1); }
    42% { transform: translate(-50%, -50%) scale(1.15); }
    70% { transform: translate(-50%, -50%) scale(1); }
}

/* Pulse rings around heart */
.loading-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: 50%;
    animation: loading-pulse-ring 1.5s ease-out infinite;
}
.loading-pulse:nth-child(2) { animation-delay: 0.5s; }
.loading-pulse:nth-child(3) { animation-delay: 1s; }
@keyframes loading-pulse-ring {
    0% { width: 80px; height: 80px; opacity: 1; }
    100% { width: 180px; height: 180px; opacity: 0; }
}

/* Brand Text */
.loading-brand {
    margin-bottom: 8px;
}
.loading-text {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #dc2626 0%, #ff6b6b 50%, #dc2626 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 2s ease infinite;
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.loading-subtitle {
    font-size: 14px;
    color: var(--gray-light);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Loading Bar */
.loading-bar-container {
    width: 250px;
    margin: 30px auto 0;
}
.loading-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ff6b6b, #dc2626);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: loading-progress 1.5s ease-in-out forwards, shimmer 1s linear infinite;
}
@keyframes loading-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.loading-percentage {
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 10px;
}

/* ===== Animated Background ===== */
.animated-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-1);
    opacity: 0.05;
    animation: float 20s infinite ease-in-out;
}
.shape-1 { width: 600px; height: 600px; top: -200px; right: -200px; }
.shape-2 { width: 400px; height: 400px; bottom: -100px; left: -100px; animation-delay: -5s; }
.shape-3 { width: 300px; height: 300px; top: 50%; left: 50%; animation-delay: -10s; }
.shape-4 { width: 200px; height: 200px; top: 30%; right: 20%; animation-delay: -15s; background: var(--gradient-2); }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 10px) rotate(3deg); }
}

/* ===== Container ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.4s ease;
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}
.logo-text { display: flex; flex-direction: column; gap: 2px; }
.logo-title { 
    font-size: 22px; 
    font-weight: 800; 
    letter-spacing: -0.5px; 
    color: white; 
    line-height: 1;
}
.logo-subtitle { 
    font-size: 11px; 
    color: rgba(255, 255, 255, 0.7); 
    font-weight: 500; 
    letter-spacing: 0.3px;
}

.nav { display: flex; gap: 8px; }
.nav-link {
    color: var(--gray-light);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--radius-xl);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}
.nav-link.games-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link.games-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.emergency-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-1);
    border: none;
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: emergency-pulse 2s infinite;
}
@keyframes emergency-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); }
}
.emergency-btn:hover { transform: scale(1.05); }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 12px;
    z-index: 1001;
    position: relative;
    transition: all 0.3s ease;
}
.mobile-menu-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}
.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    z-index: 1;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(220, 38, 38, 0.3);
}
.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
}
.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
.hero-description {
    font-size: 18px;
    color: var(--gray-light);
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 500px;
}

/* ===== Search Box ===== */
.search-container {
    position: relative;
    margin-bottom: 40px;
}
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 999px;
    padding: 4px 6px;
    box-shadow: 0 12px 35px rgba(15,23,42,0.45);
    transition: all 0.25s ease;
}
.search-box:focus-within {
    border-color: rgba(248,113,113,0.9);
    box-shadow: 0 18px 45px rgba(248,113,113,0.55);
}
.search-icon {
    padding: 0 16px;
    color: #f97373;
    font-size: 18px;
}
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    color: #111827;
    font-size: 15px;
    padding: 10px 0;
    font-weight: 500;
}
.search-input:focus {
    outline: none !important;
    box-shadow: none !important;
}
.search-input::placeholder { 
    color: #9ca3af;
    font-weight: 400;
}

/* Clear Search Button */
.clear-search-btn {
    background: none;
    border: none;
    color: var(--gray-light);
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}
.clear-search-btn:hover { color: var(--white); }

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-1);
    border: none;
    color: var(--white);
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-btn:hover { transform: scale(1.02); }

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--dark-light);
    border-radius: var(--radius-md);
    margin-top: 8px;
    overflow: hidden;
    display: none;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}
.search-suggestions.show { display: block; }
.suggestion-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}
.suggestion-item:hover { background: rgba(255,255,255,0.05); }
.suggestion-item i { color: var(--primary); }
.suggestion-badge {
    margin-left: auto;
    padding: 4px 12px;
    background: rgba(220, 38, 38, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 32px;
}
.stat-item { text-align: center; }
.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 14px; color: var(--gray-light); }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.1); }

/* Quick Access Buttons */
.quick-access-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 32px;
}
.quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    color: var(--gray-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}
.quick-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}
.quick-btn i {
    font-size: 16px;
    color: var(--primary);
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image-container {
    position: relative;
    width: 350px; height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pulse-ring {
    position: absolute;
    width: 100%; height: 100%;
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: 50%;
    animation: pulse-ring 3s infinite;
}
.delay-1 { animation-delay: 1s; }
.delay-2 { animation-delay: 2s; }
@keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}
.hero-icon {
    width: 150px; height: 150px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.4);
}

/* ===== Main Categories Section ===== */
.main-categories-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}
.main-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.main-category-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}
[data-theme="light"] .main-category-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.main-category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--gradient-1);
    transform: scaleY(0);
    transition: transform 0.4s ease;
}
.main-category-card:hover, .main-category-card.active {
    background: var(--bg-card-hover);
    border-color: rgba(220, 38, 38, 0.3);
    transform: translateY(-4px);
}
[data-theme="light"] .main-category-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.main-category-card:hover::before, .main-category-card.active::before {
    transform: scaleY(1);
}
.main-category-icon {
    width: 70px; height: 70px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.main-category-icon.ilac { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.main-category-icon.ilac-list { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.main-category-icon.favorites { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.main-category-card:hover .main-category-icon {
    transform: scale(1.1);
}
.main-category-info { flex: 1; }
.main-category-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.main-category-info p { color: var(--gray-light); font-size: 14px; }
.main-category-arrow {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
    transition: all 0.3s ease;
}
.main-category-card:hover .main-category-arrow {
    background: var(--gradient-1);
    color: var(--white);
    transform: translateX(5px);
}

/* Favorites Card Special */
.favorites-card .main-category-icon i {
    animation: star-pulse 2s infinite;
}
@keyframes star-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Sub Categories */
.subcategories-section {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

/* ===== Categories Section ===== */
.categories-section {
    padding: 80px 0;
    position: relative;
    z-index: 1;
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-tag {
    display: inline-block;
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    padding: 6px 16px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(220, 38, 38, 0.3);
}
.section-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.section-description {
    color: var(--gray-light);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.category-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-light);
    font-weight: 500;
}
.category-card:hover, .category-card.active {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary);
    color: var(--white);
    transform: translateY(-4px);
}
.category-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}
.category-card:hover .category-icon,
.category-card.active .category-icon {
    background: var(--gradient-1);
}
.category-icon.cardiac { color: #ef4444; }
.category-icon.respiratory { color: #3b82f6; }
.category-icon.trauma { color: #f59e0b; }
.category-icon.neurology { color: #8b5cf6; }
.category-icon.pediatric { color: #10b981; }
.category-icon.toksikoloji { color: #dc2626; }
.category-icon.obstetrik { color: #ec4899; }
.category-icon.yenidogan { color: #06b6d4; }
.category-icon.genel { color: #6366f1; }
.category-icon.triyaj { color: #eab308; }

/* ===== Protocols Section ===== */
.protocols-section {
    padding: 80px 0 120px;
    position: relative;
    z-index: 1;
}
.protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Protocol Card */
.protocol-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}
.protocol-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}
.protocol-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
[data-theme="light"] .protocol-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
[data-theme="light"] .protocol-card:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.protocol-card:hover::before { transform: scaleX(1); }

.protocol-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}
.protocol-icon {
    width: 52px; height: 52px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.protocol-card:hover .protocol-icon {
    background: var(--gradient-1);
    color: var(--white);
}
.protocol-info { flex: 1; }
.protocol-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}
.protocol-category {
    font-size: 13px;
    color: var(--gray-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.protocol-category i { font-size: 10px; color: var(--primary); }

.protocol-description {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 12px;
}
.protocol-footer {
    display: flex;
    align-items: center;
    justify-content: center;
}
.protocol-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-light);
    background: rgba(255,255,255,0.05);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}
.protocol-tag i { color: var(--primary); }
.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}
.view-btn:hover { gap: 12px; }

/* Favorite Button */
.favorite-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 50%;
    color: var(--gray-light);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.favorite-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    transform: scale(1.1);
}
.favorite-btn.active {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}
.favorite-btn.active i {
    animation: heart-beat 0.5s ease;
}
@keyframes heart-beat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* File Type Badge */
.file-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.file-type-badge.pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.file-type-badge.xlsx, .file-type-badge.xls {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.file-type-badge.doc, .file-type-badge.docx {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
}
.no-results-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--gray);
    margin: 0 auto 24px;
}
.no-results h3 { font-size: 24px; margin-bottom: 8px; }
.no-results p { color: var(--gray-light); }

/* ===== About Section ===== */
.about-section {
    padding: 100px 0;
    background: rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.about-text p {
    color: var(--gray-light);
    line-height: 1.8;
    margin-bottom: 16px;
}
.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.feature-item i { color: #10b981; }

.about-visual { display: flex; justify-content: center; }
.about-card {
    background: var(--gradient-1);
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 300px;
}
.about-card-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 24px;
}
.about-card h3 { font-size: 18px; margin-bottom: 8px; }
.emergency-number {
    font-size: 64px;
    font-weight: 800;
    display: block;
    margin: 16px 0;
}
.about-card span { opacity: 0.9; }

/* ===== Footer ===== */
.footer {
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
}
.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer-brand p { color: var(--gray-light); margin-top: 16px; }
.footer-links h4, .footer-contact h4 {
    font-size: 16px;
    margin-bottom: 20px;
}
.footer-links a {
    display: block;
    color: var(--gray-light);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--white); }
.footer-contact p {
    color: var(--gray-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-contact i { color: var(--primary); }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--gray);
    font-size: 14px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
}
.modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    background: var(--dark-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.modal-header h3 { font-size: 18px; }
.modal-actions { display: flex; gap: 12px; }
.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
}
.download-btn {
    background: var(--gradient-1);
    color: var(--white);
}
.newtab-btn {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}
.close-btn {
    background: rgba(255,255,255,0.05);
    color: var(--gray-light);
}
.modal-btn:hover { transform: scale(1.05); }
.modal-body { flex: 1; overflow: hidden; }
.modal-body iframe { width: 100%; height: 100%; background: var(--white); }

/* ===== Mobile Menu ===== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--dark);
    z-index: 3000;
    padding: 24px;
    flex-direction: column;
}
.mobile-menu.show,
.mobile-menu.active { display: flex; }
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}
.mobile-menu-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
}
.mobile-nav { display: flex; flex-direction: column; gap: 8px; }
.mobile-nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 24px;
    font-weight: 600;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}
.mobile-nav a:hover { color: var(--primary); }
.mobile-nav-special {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    margin: 8px 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 22px !important;
}
.mobile-nav-special:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(118, 75, 162, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero .container { grid-template-columns: 1fr; text-align: center; }
    .hero-description { margin: 0 auto 40px; }
    .hero-visual { display: none; }
    .hero-stats { justify-content: center; }
    .about-content { grid-template-columns: 1fr; }
    .quick-access-buttons { justify-content: center; }
}
@media (max-width: 768px) {
    .nav, .header-actions { display: none; }
    .mobile-menu-btn { display: block; }
    .hero-title { font-size: 40px; }
    .section-title { font-size: 32px; }
    .category-grid { gap: 12px; }
    .category-card { padding: 16px 20px; }
    .protocols-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 32px; }
    .search-btn span { display: none; }
    .search-btn { padding: 14px 18px; }
    .main-category-grid { grid-template-columns: 1fr; }
    .main-category-card { padding: 20px; }
    .main-category-icon { width: 56px; height: 56px; font-size: 24px; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 32px; }
    .hero-stats { flex-wrap: wrap; }
    .stat-divider { display: none; }
    .modal-actions { flex-wrap: wrap; }
    .modal-btn span { display: none; }
}

/* ===== Scroll to Top Button ===== */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}
.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--dark-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    max-width: 350px;
}
.toast.success { border-left: 4px solid #10b981; }
.toast.success i { color: #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.error i { color: #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }
.toast.info i { color: #3b82f6; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
.toast.hide {
    animation: toast-out 0.3s ease forwards;
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ===== PDF Loading ===== */
.pdf-loading {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
}
.pdf-loading.hidden { display: none; }
.pdf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.pdf-loading p {
    color: var(--gray-light);
    font-size: 14px;
}

/* ===== Protocol Card Enhancements ===== */
.protocol-card {
    animation: card-appear 0.5s ease forwards;
    opacity: 0;
}
@keyframes card-appear {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Active Category Indicator ===== */
.category-card.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 3px;
}
.category-card {
    position: relative;
}

/* ===== Search Result Count ===== */
.result-count {
    text-align: center;
    color: var(--gray-light);
    font-size: 14px;
    margin-bottom: 24px;
}
.result-count strong {
    color: var(--primary);
}

/* ===== Emergency Button Link Style ===== */
a.emergency-btn {
    text-decoration: none;
}

/* ===== Keyboard Focus Styles ===== */
.protocol-card:focus,
.category-card:focus,
.nav-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Search input has its own focus style via parent .search-box */

/* ===== AI Chat Widget ===== */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}
.chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
    transition: all 0.3s ease;
}
.chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(220, 38, 38, 0.5);
}
.chat-btn.active {
    transform: scale(0.9);
}
.chat-btn-icon {
    font-size: 24px;
    color: white;
}
.chat-btn-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-1);
    animation: chat-pulse 2s infinite;
    z-index: -1;
}
@keyframes chat-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}
.chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.chat-header {
    padding: 16px 20px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    position: relative;
}
.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #dc2626;
}
.chat-header-text h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.chat-header-text span {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
}
.chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}
.chat-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-primary);
}
.chat-message {
    display: flex;
    gap: 10px;
    animation: message-in 0.3s ease;
}
@keyframes message-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-message.user {
    flex-direction: row-reverse;
}
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    color: var(--gray-light);
}
.message-avatar.ai-avatar {
    background: var(--gradient-1);
    color: white;
}
.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.chat-message.user .message-content {
    background: var(--gradient-1);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-message.ai .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}
.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--gray-light);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Protocol Suggestions */
.suggested-protocols {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.protocol-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.protocol-suggestion:hover {
    background: rgba(220, 38, 38, 0.2);
    transform: translateX(4px);
}
.protocol-suggestion i {
    color: var(--primary);
}

/* Drug Info */
.drug-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-primary);
}
.drug-info i {
    color: #10b981;
}
.drug-info button {
    margin-left: auto;
    padding: 4px 10px;
    background: #10b981;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    cursor: pointer;
}

/* Chat Input */
.chat-input-area {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}
.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}
.chat-input-area input:focus {
    border-color: var(--primary);
}
.chat-input-area input::placeholder {
    color: var(--text-secondary);
}
.chat-send {
    width: 44px;
    height: 44px;
    background: var(--gradient-1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}
.chat-send:hover {
    transform: scale(1.1);
}

/* Light Theme Chat */
[data-theme="light"] .chat-window {
    background: #ffffff;
    box-shadow: 0 10px 50px rgba(0,0,0,0.15);
}
[data-theme="light"] .chat-messages {
    background: #f8fafc;
}
[data-theme="light"] .chat-message.ai .message-content {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .chat-input-area {
    background: #ffffff;
    border-color: #e2e8f0;
}
[data-theme="light"] .chat-input-area input {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* Mobile Chat */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 32px);
        height: 70vh;
        right: -8px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header, .footer, .modal, .scroll-top-btn, .animated-bg, .chat-widget { display: none !important; }
    body { background: white; color: black; }
}
