/* EasyMed - Complete Stylesheet */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --secondary: #0284c7;
    --secondary-dark: #0369a1;
    --accent: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-50); color: var(--gray-800); line-height: 1.6; min-height: 100vh; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-fluid { max-width: 100%; padding: 0 20px; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--dark); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--gray-600); }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
.section-title { text-align: center; margin-bottom: 0.5rem; }
.section-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 3rem; font-size: 1.1rem; }

/* Header */
.main-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.main-header .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; color: var(--dark); }
.logo img { height: 36px; }
.logo span { color: var(--primary); }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: var(--gray-600); font-size: 0.9rem; font-weight: 500; padding: 6px 0; position: relative; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.main-nav a.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 2px; }
.mobile-toggle { display: none; flex-direction: column; cursor: pointer; gap: 5px; padding: 5px; }
.mobile-toggle span { width: 24px; height: 2px; background: var(--gray-600); border-radius: 2px; transition: 0.3s; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 24px; border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; line-height: 1.4; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-outline-light { background: transparent; border: 2px solid white; color: white; }
.btn-outline-light:hover { background: white; color: var(--primary); }
.btn-sm { padding: 6px 16px; font-size: 0.825rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); transform: none; box-shadow: none; }

/* Cards */
.card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; transition: all 0.3s; }
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { padding: 24px; }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--gray-200); font-weight: 600; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 11px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius); font-size: 0.95rem; transition: all 0.2s; background: white; color: var(--gray-800); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1); }
.form-input.error, .form-select.error { border-color: var(--danger); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.form-check input[type="checkbox"], .form-check input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0f766e 0%, #059669 40%, #0284c7 100%);
    color: white;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1587854692152-cbe660dbde88?w=1920&q=80') center/cover;
    opacity: 0.08;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 3rem; color: white; margin-bottom: 16px; font-weight: 800; }
.hero h1 span { color: #fcd34d; }
.hero p { font-size: 1.2rem; color: rgba(255,255,255,0.9); margin-bottom: 32px; max-width: 700px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Medicine Card */
.medicine-card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: all 0.3s; }
.medicine-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.medicine-card .image-wrap { height: 200px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.medicine-card .image-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.medicine-card .badge { position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.medicine-card .badge-rx { background: var(--danger); color: white; }
.medicine-card .badge-otc { background: var(--success); color: white; }
.medicine-card .badge-discount { background: var(--accent); color: white; right: 12px; left: auto; }
.medicine-card .info { padding: 16px; }
.medicine-card .name { font-weight: 600; font-size: 1rem; color: var(--dark); margin-bottom: 4px; display: block; }
.medicine-card .generic { font-size: 0.85rem; color: var(--gray-400); margin-bottom: 8px; }
.medicine-card .vendor { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 8px; }
.medicine-card .price-row { display: flex; align-items: center; justify-content: space-between; }
.medicine-card .price { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.medicine-card .price-compare { font-size: 0.9rem; color: var(--gray-400); text-decoration: line-through; margin-left: 8px; }
.medicine-card .rating { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--gray-500); }
.medicine-card .rating .stars { color: var(--accent); }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Alerts */
.alert { padding: 14px 20px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; display: flex; align-items: center; gap: 12px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* Search */
.search-box { display: flex; gap: 0; max-width: 600px; margin: 0 auto; }
.search-box input { flex: 1; padding: 14px 20px; border: 2px solid var(--gray-200); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 1rem; }
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box button { padding: 14px 28px; background: var(--primary); color: white; border: none; border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.search-box button:hover { background: var(--primary-dark); }

/* Footer */
.main-footer { background: var(--dark); color: white; padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer-col p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,0.6); font-size: 0.9rem; }
.footer-col ul li a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.9rem; color: rgba(255,255,255,0.5); }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: white; transition: background 0.3s; font-size: 1.1rem; }
.social-links a:hover { background: var(--primary); }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } .main-nav { display: none; } .mobile-toggle { display: flex; } .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: white; padding: 20px; box-shadow: var(--shadow-lg); border-top: 1px solid var(--gray-200); } }

/* Dashboard Layout */
.dashboard-layout { display: flex; min-height: calc(100vh - 70px); }
.dashboard-sidebar { width: 260px; background: white; border-right: 1px solid var(--gray-200); padding: 24px 0; flex-shrink: 0; overflow-y: auto; position: sticky; top: 70px; height: calc(100vh - 70px); }
.dashboard-sidebar .nav-section { padding: 0 16px; margin-bottom: 24px; }
.dashboard-sidebar .nav-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--gray-400); padding: 0 12px; margin-bottom: 8px; letter-spacing: 0.05em; }
.dashboard-sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--gray-600); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; margin-bottom: 2px; }
.dashboard-sidebar .nav-item:hover { background: var(--gray-100); color: var(--primary); }
.dashboard-sidebar .nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.dashboard-sidebar .nav-item .icon { width: 20px; text-align: center; font-size: 1.1rem; }
.dashboard-content { flex: 1; padding: 32px; min-width: 0; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.dashboard-header h1 { font-size: 1.5rem; }
.dashboard-header .actions { display: flex; gap: 12px; }
@media (max-width: 768px) { .dashboard-sidebar { display: none; } .dashboard-content { padding: 20px; } }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 4px; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--dark); }
.stat-card .change { font-size: 0.85rem; margin-top: 4px; }
.stat-card .change.up { color: var(--success); }
.stat-card .change.down { color: var(--danger); }
.stat-card .icon-wrap { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 12px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--gray-50); }
th { padding: 12px 16px; text-align: left; font-weight: 600; color: var(--gray-600); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid var(--gray-200); }
td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tr:hover td { background: var(--gray-50); }

/* Filters */
.filters-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; padding: 16px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.filters-bar .form-input, .filters-bar .form-select { width: auto; min-width: 180px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab { padding: 10px 20px; font-weight: 500; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius-xl); max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 12px; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--gray-100); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--gray-500); }

/* Product Verification */
.verify-container { max-width: 600px; margin: 60px auto; text-align: center; }
.verify-container .result { margin-top: 30px; padding: 30px; border-radius: var(--radius-lg); }
.verify-container .result.authentic { background: #d1fae5; border: 2px solid #a7f3d0; }
.verify-container .result.fake { background: #fee2e2; border: 2px solid #fecaca; }

/* Status Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--gray-300); border: 3px solid white; }
.timeline-item.completed::before { background: var(--success); }
.timeline-item.active::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2); }

/* Cart */
.cart-item { display: flex; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--gray-100); }
.cart-item img { width: 80px; height: 80px; object-fit: contain; border-radius: var(--radius); background: var(--gray-100); }
.cart-item .item-info { flex: 1; }
.cart-item .item-name { font-weight: 600; }
.cart-item .item-price { color: var(--primary); font-weight: 700; }
.cart-item .qty-controls { display: flex; align-items: center; gap: 8px; }
.cart-item .qty-controls button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--gray-200); background: white; cursor: pointer; font-size: 1rem; }
.cart-item .qty-controls span { min-width: 30px; text-align: center; font-weight: 600; }
.cart-item .remove-btn { color: var(--danger); cursor: pointer; background: none; border: none; font-size: 1.2rem; }

/* Chat */
.chat-container { display: flex; height: calc(100vh - 250px); min-height: 400px; background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.chat-sidebar { width: 300px; border-right: 1px solid var(--gray-200); overflow-y: auto; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; }
.chat-message { margin-bottom: 16px; display: flex; }
.chat-message.sent { justify-content: flex-end; }
.chat-message .bubble { max-width: 70%; padding: 12px 16px; border-radius: 16px; font-size: 0.9rem; }
.chat-message.sent .bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.chat-message.received .bubble { background: var(--gray-100); border-bottom-left-radius: 4px; }
.chat-input-wrap { padding: 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 12px; }
.chat-input-wrap input { flex: 1; padding: 12px 16px; border: 1px solid var(--gray-200); border-radius: 24px; }

/* Star Rating */
.stars { color: var(--accent); font-size: 1.1rem; letter-spacing: 2px; }
.stars .empty { color: var(--gray-200); }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.hidden { display: none; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.bg-white { background: white; }
.bg-light { background: var(--gray-50); }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--accent); }
.text-muted { color: var(--gray-500); }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Page hero small */
.page-hero {
    background: linear-gradient(135deg, #0f766e, #059669);
    color: white;
    padding: 40px 0 30px;
}
.page-hero h1 { color: white; font-size: 1.8rem; }
.page-hero p { color: rgba(255,255,255,0.8); }
