/*
Theme Name: MediCare - AI Medical Theme
Theme URI: https://imedicare.surf
Description: Complete AI-Powered Medical WordPress Theme with Chatbot, Visitor Counter, Medicine Database, AI Report Parser & AdSense Slots.
Author: Nisar
Author URI: https://imedicare.surf
Version: 2.1.0
Requires at least: 5.0
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: medicare
Domain Path: /languages
Tags: medical, health, ai, chatbot, responsive, medicine, doctor, hospital
*/

/* ============ ROOT VARIABLES ============ */

:root {
    --primary: #1e40af;
    --primary-light: #eff6ff;
    --secondary: #0891b2;
    --secondary-light: #ecfeff;
    --accent: #0d9488;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ RESET ============ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    background-color: #f1f5f9;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============ TYPOGRAPHY ============ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1rem;
    color: var(--gray);
}

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

a:hover {
    color: var(--secondary);
}

button, [role="button"] {
    font-family: inherit;
    transition: var(--transition);
}

/* ============ LAYOUT ============ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* ============ ADSENSE CONTAINER ============ */

.medicare-adsense-slot {
    margin: 1.5rem auto;
    text-align: center;
    padding: 0.5rem;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: 8px;
    max-width: 100%;
    overflow: hidden;
}

.medicare-adsense-slot::before {
    content: "ADVERTISEMENT";
    display: block;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--gray);
    margin-bottom: 5px;
}

/* ============ HEADER ============ */

header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.site-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.site-title a {
    color: var(--primary);
    font-weight: 700;
}

.site-description {
    font-size: 12px;
    color: var(--gray);
    margin: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 0;
}

nav a:hover, nav li.current-menu-item a {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* ============ HERO SECTION ============ */

.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 2.8rem;
    color: white;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ BUTTONS ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.2);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--light);
    transform: translateY(-2px);
}

/* ============ CARDS ============ */

.medicare-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* ============ REPORT ANALYZER UI ============ */

.analyzer-container {
    max-width: 900px;
    margin: 0 auto;
}

.analyzer-upload-box {
    border: 2px dashed var(--secondary);
    background: var(--secondary-light);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.analyzer-upload-box:hover {
    background: #e0f7fa;
    border-color: var(--primary);
}

.analyzer-upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.report-textarea {
    width: 100%;
    min-height: 180px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 1.5rem;
    resize: vertical;
}

.report-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Tabbed Results */
.analysis-results {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.analysis-results.active {
    display: block;
}

.results-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    gap: 10px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Biomarker status cards */
.biomarker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.biomarker-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 5px solid var(--gray);
    transition: var(--transition);
}

.biomarker-card.status-high { border-left-color: var(--danger); background: #fef2f2; }
.biomarker-card.status-low { border-left-color: var(--warning); background: #fffbeb; }
.biomarker-card.status-normal { border-left-color: var(--success); background: #f0fdf4; }

.biomarker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.biomarker-name {
    font-weight: 600;
    font-size: 15px;
}

.biomarker-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-high .biomarker-status-badge { background: #fee2e2; color: var(--danger); }
.status-low .biomarker-status-badge { background: #fef3c7; color: var(--warning); }
.status-normal .biomarker-status-badge { background: #dcfce7; color: var(--success); }

.biomarker-value-box {
    margin-bottom: 10px;
}

.biomarker-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.biomarker-ref {
    font-size: 12px;
    color: var(--gray);
    margin-left: 8px;
}

.biomarker-desc {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
}

/* Specialist Card */
.specialist-card {
    background: var(--primary-light);
    border: 1px solid rgba(30, 64, 175, 0.1);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 2rem;
}

.specialist-title {
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* ============ MEDICINE LOOKUP UI ============ */

.medicine-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
}

.med-search-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

.med-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.medicine-results {
    display: none;
    animation: fadeIn 0.4s ease;
}

.medicine-results.active {
    display: block;
}

.medicine-tabs-content {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.alert-box {
    border-left: 4px solid var(--danger);
    background: #fff5f5;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-box-title {
    font-weight: 700;
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 5px;
}

/* ============ 5-MINUTE MEDICAL NEWS GRID ============ */

.medicare-news-container {
    margin-top: 3rem;
}

.medicare-news-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.medicare-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.news-card h4 {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-card h4 a {
    color: var(--dark);
}

.news-card h4 a:hover {
    color: var(--primary);
}

.news-date {
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 12px;
    display: block;
    font-weight: 500;
}

.news-card p {
    font-size: 13px;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 15px;
}

.news-readmore {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    align-self: flex-start;
}

/* ============ FLOATING CHATBOT WIDGET ============ */

#chatbot-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 12px 24px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 8px;
}

#chatbot-toggle:hover {
    transform: scale(1.05);
}

#imedicare-chatbot {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 400px;
    height: 550px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 999;
    border: 1px solid var(--border);
    overflow: hidden;
}

#imedicare-chatbot.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-logo {
    font-size: 24px;
}

.chatbot-header h3 {
    font-size: 15px;
    margin: 0;
    color: white;
}

.chatbot-status {
    font-size: 11px;
    opacity: 0.85;
    display: block;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bot-message, .user-message {
    display: flex;
    max-width: 85%;
}

.bot-message {
    align-self: flex-start;
}

.bot-message p {
    background: white;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 0px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--dark);
    margin: 0;
}

.user-message {
    align-self: flex-end;
}

.user-message p {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 0px 12px;
    font-size: 13.5px;
    margin: 0;
}

/* Chatbot Presets */
.chatbot-presets {
    align-self: center;
    width: 100%;
    margin-top: 10px;
}

.presets-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
    text-align: center;
}

.presets-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.preset-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13.5px;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chatbot-send {
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.chatbot-send:hover {
    background: var(--secondary);
}

.chatbot-disclaimer {
    font-size: 10px;
    color: var(--gray);
    text-align: center;
    padding: 0 10px 8px;
    margin: 0;
    background: white;
}

/* Visitor counter stats */
.visitor-counter-box {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    color: white;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    margin: 2.5rem 0;
}

.counter-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.counter-card {
    text-align: center;
}

.counter-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.counter-val {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

/* Loading dots animation */
.dot-loader {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: bounce 0.6s infinite alternate;
}

@keyframes bounce {
    to { transform: translateY(-4px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ FOOTER ============ */

.site-footer {
    background: var(--dark);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 1.25rem;
}

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

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

.footer-section a {
    color: #94a3b8;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero h1 { font-size: 2.2rem; }
    
    #imedicare-chatbot {
        width: calc(100% - 40px);
        height: 500px;
        right: 20px;
        bottom: 85px;
    }
    
    .counter-grid {
        gap: 1.5rem;
        flex-direction: column;
    }
}
