/* =============================================
   MedCompare - Design System
   ============================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    --primary: #0A1628;
    --primary-hover: #112240;
    --accent: #14C5A0;
    --accent-dark: #0fa888;
    --accent-glow: rgba(20, 197, 160, 0.25);
    --light-bg: #F4F7FE;
    --card-bg: #FFFFFF;
    --text-dark: #0A1628;
    --text-muted: #647192;
    --border: rgba(10, 22, 40, 0.08);
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 12px rgba(10, 22, 40, 0.07);
    --shadow-md: 0 8px 30px rgba(10, 22, 40, 0.10);
    --shadow-lg: 0 16px 56px rgba(10, 22, 40, 0.14);
    --transition: all 0.25s ease;
}

/* --- Global Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light-bg);
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(10, 22, 40, 0.05);
    transition: var(--transition);
    padding: 0.75rem 0;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.10);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary) !important;
    letter-spacing: -0.5px;
}

.navbar-brand span {
    color: var(--accent);
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary) !important;
}

/* --- Navbar Buttons --- */
.btn-nav-outline {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1.2rem;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
}

.btn-nav-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-nav-primary {
    background: var(--accent);
    color: var(--primary) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1.2rem;
    font-weight: 700;
    font-size: 0.88rem;
    transition: var(--transition);
}

.btn-nav-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* =============================================
   LANDING PAGE — HERO
   ============================================= */
.hero-section {
    position: relative;
    min-height: 92vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, #112240 55%, #1a3a6e 100%);
    overflow: hidden;
    padding: 6rem 0 5rem;
}

/* Animated blobs */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    animation: blobFloat 8s ease-in-out infinite alternate;
    will-change: transform;
}

.hero-blob-1 {
    width: 520px;
    height: 520px;
    background: var(--accent);
    top: -120px;
    right: -100px;
}

.hero-blob-2 {
    width: 360px;
    height: 360px;
    background: #4a8fe8;
    bottom: -80px;
    left: -100px;
    animation-delay: -3s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.08);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(20, 197, 160, 0.15);
    border: 1px solid rgba(20, 197, 160, 0.35);
    color: var(--accent);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.4);
    }
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.25rem;
}

.hero-title .highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 520px;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-hero-primary:hover {
    background: var(--accent-dark);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.30);
    border-radius: var(--radius-sm);
    padding: 0.85rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Hero stats bar */
.hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 3.5rem;
    flex-wrap: wrap;
}

.hero-stat-item {
    text-align: left;
}

.hero-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.2rem;
    font-weight: 500;
}

/* Hero illustration panel */
.hero-visual {
    position: relative;
    z-index: 2;
}

/* Hero product image */
.hero-product-img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: var(--radius);
    display: block;
    margin: 0 auto 1.5rem auto;
    object-fit: cover;
    box-shadow: 0 24px 60px rgba(10, 22, 40, 0.35);
    position: relative;
    z-index: 1;
}

.hero-card-float {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    color: white;
    animation: floatCard 4s ease-in-out infinite alternate;
}

@keyframes floatCard {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-14px);
    }
}

.hero-card-float .card-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.hero-card-float .card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.hero-card-float .card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.hero-mini-card {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    padding: 0.9rem 1.2rem;
    margin-top: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: floatCard 5s ease-in-out infinite alternate;
    animation-delay: -2s;
}

.hero-mini-card .mini-icon {
    width: 38px;
    height: 38px;
    background: var(--accent-glow);
    border: 1px solid rgba(20, 197, 160, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
}

.hero-mini-card .mini-text strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
}

.hero-mini-card .mini-text span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

/* =============================================
   SECTION COMMONS
   ============================================= */
.section-pad {
    padding: 5rem 0;
}

.section-tag {
    display: inline-block;
    background: rgba(20, 197, 160, 0.10);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    margin-bottom: 0.9rem;
}

.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.6rem);
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.7;
}

/* =============================================
   FEATURES SECTION
   ============================================= */
.features-section {
    background: #fff;
}

.feature-card {
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #4a8fe8);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(20, 197, 160, 0.25);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(20, 197, 160, 0.15), rgba(20, 197, 160, 0.05));
    border: 1px solid rgba(20, 197, 160, 0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent-dark);
    margin-bottom: 1.25rem;
}

.feature-card h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* =============================================
   HOW IT WORKS SECTION
   ============================================= */
.how-section {
    background: var(--light-bg);
}

.step-card {
    text-align: center;
    padding: 2.5rem 2rem;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #1a3a6e);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 auto 1.25rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 20px rgba(10, 22, 40, 0.20);
}

.step-connector {
    position: absolute;
    top: 30px;
    left: calc(50% + 30px);
    width: calc(100% - 60px);
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    z-index: 0;
}

.step-card h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* Fade-in animation (JS-driven) */
.fade-in-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, #112240 60%, #1a3a6e 100%);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    top: -100px;
    right: -100px;
}

.cta-section .cta-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.cta-section .cta-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

/* =============================================
   FACETED SIDEBAR
   ============================================= */
.filter-sidebar {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: var(--radius);
}

.filter-sidebar .form-label {
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.filter-sidebar .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-sidebar .form-check-label {
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.filter-sidebar .form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.2em;
    cursor: pointer;
}

/* Custom Soft Primary Badge */
.bg-soft-primary {
    background: rgba(10, 22, 40, 0.05);
    border: 1px solid rgba(10, 22, 40, 0.08);
}

/* =============================================
   GLASS CARDS & MEDICINES LIST
   ============================================= */
.filter-bar,
.medicine-card,
.medicine-detail-card {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(10, 22, 40, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.medicine-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.15);
    border-color: rgba(255, 255, 255, 0.9) !important;
}

/* =============================================
   GENERAL CARD STYLING
   ============================================= */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

/* =============================================
   FORM CONTROLS
   ============================================= */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #dde3f0;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--text-dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* Legacy input overrides */
input[type="text"],
input[type="password"],
input[type="email"] {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: #fff;
    border: 1.5px solid #dde3f0;
    border-radius: var(--radius-sm);
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* =============================================
   AUTH PAGES — SPLIT LAYOUT + FULL PAGES
   ============================================= */
.auth-wrapper,
.full-page-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    background-image: url("../images/auth_bg_light.7f475edf060b.webp");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 1;
}

.full-page-wrapper {
    align-items: flex-start;
    padding-top: 5rem;
}

.auth-wrapper::before,
.full-page-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    z-index: -1;
}

/* Unified Glass Panel containers */
.auth-glass-panel,
.glass-container {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.12);
    overflow: hidden;
}

.auth-glass-panel {
    flex-direction: row;
    max-width: 960px;
    margin: 0 auto;
}

.glass-container {
    flex-direction: column;
    max-width: 100%;
}

.auth-panel-left {
    width: 44%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3.5rem 3rem;
    position: relative;
}

.auth-panel-left .brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 4px 16px rgba(255, 255, 255, 0.6);
    letter-spacing: -0.5px;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
    text-decoration: none;
}

.auth-panel-left .brand span {
    color: var(--accent);
}

.auth-left-content {
    position: relative;
    z-index: 1;
}

.auth-left-content h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}

.auth-left-content p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 2rem;
    font-weight: 500;
}

.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
}

.auth-feature-list li .check-icon {
    width: 24px;
    height: 24px;
    background: rgba(20, 197, 160, 0.20);
    border: 1px solid rgba(20, 197, 160, 0.40);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.auth-panel-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.45);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    overflow-y: auto;
}

.auth-form-box .form-control {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-form-box {
    width: 100%;
    max-width: 440px;
}

.auth-form-box h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.auth-form-box .auth-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form-box .form-group {
    margin-bottom: 1.1rem;
}

/* Input with icon */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.input-icon-wrap input,
.input-icon-wrap textarea {
    padding-left: 2.6rem !important;
}

.input-icon-wrap textarea {
    padding-top: 0.75rem !important;
}

/* Align icon to top for textareas */
.input-icon-wrap:has(textarea) .input-icon {
    top: 1.1rem;
    transform: none;
}

/* Submit button */
.btn-auth-submit {
    width: 100%;
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-auth-submit:hover {
    background: var(--accent-dark);
    color: var(--primary);
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-2px);
}

/* Role toggle buttons */
.role-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid #dde3f0;
    background: #fff;
    margin-bottom: 1.5rem;
}

.role-toggle input[type="radio"] {
    display: none;
}

.role-toggle label {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    margin: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.role-toggle input[type="radio"]:checked+label {
    background: var(--primary);
    color: #fff;
}

/* Divider in signup */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Auth link */
.auth-alt-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-alt-link a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.auth-alt-link a:hover {
    text-decoration: underline;
}

/* Responsive: auth split becomes single column on mobile */
@media (max-width: 768px) {
    .auth-glass-panel {
        flex-direction: column;
    }

    .auth-panel-left {
        width: 100%;
        padding: 2.5rem 1.5rem;
        min-height: auto;
    }

    .auth-panel-left .auth-left-content h2 {
        font-size: 1.5rem;
    }

    .auth-panel-right {
        padding: 2.5rem 1.25rem;
    }
}

/* =============================================
   GENERAL BUTTON OVERRIDES (Bootstrap compat)
   ============================================= */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 22, 40, 0.2);
}

.custom-text-primary {
    color: var(--primary) !important;
}

.custom-bg-primary {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-outline-danger {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
}

/* Medicine Card Action Buttons */
.btn-action-edit {
    color: #ce7d00; /* Deep orange-ish for better contrast in light mode */
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-action-edit:hover {
    background-color: rgba(206, 125, 0, 0.1);
    color: #a66500;
}

[data-theme="dark"] .btn-action-edit {
    color: #ffc107; /* Standard yellow for dark mode */
}

[data-theme="dark"] .btn-action-edit:hover {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffca2c;
}

.btn-action-delete {
    color: #dc3545;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-action-delete:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #a71d2a;
}

[data-theme="dark"] .btn-action-delete {
    color: #ea868f; /* Lighter red for dark mode */
}

[data-theme="dark"] .btn-action-delete:hover {
    background-color: rgba(234, 134, 143, 0.15);
    color: #f1aeb5;
}

/* =============================================
   SIGNUP FORM HELPERS
   ============================================= */
.transition {
    transition: var(--transition);
}

.btn-hover-transform:hover {
    transform: translateY(-2px);
}

#signup-form input:focus,
#signup-form textarea:focus {
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
    border-color: var(--accent);
}

#signup-form .form-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

#signup-form ul {
    padding-left: 1rem;
    margin-bottom: 0;
}

/* =============================================
   ALERT / MESSAGES
   ============================================= */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border: none;
}

/* Premium Rating Badge */
.badge-rating {
    background: #0A1628;
    color: #FFC107 !important;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.5rem 0.75rem;
    font-weight: 700;
}

.badge-rating i {
    color: #FFC107;
}

[data-theme="dark"] .badge-rating {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107 !important;
    border-color: rgba(255, 193, 7, 0.4);
}

/* Category Badge */
.category-badge {
    background: #f0f4f9;
    color: var(--primary) !important;
    border: 1px solid rgba(10, 22, 40, 0.08);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.2px;
}

[data-theme="dark"] .category-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.12);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    padding: 1.75rem 0;
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--accent);
    text-decoration: underline;
}

.site-footer a:hover {
    text-decoration: none;
}

.text-accent {
    color: var(--accent) !important;
}

.footer-disclaimer a:hover {
    color: var(--accent-dark) !important;
}

/* Ensure links in text are distinguishable */
p a:not(.btn),
.card-text a:not(.btn) {
    text-decoration: underline;
}

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */
[data-theme="dark"] {
    --primary: #F4F7FE;
    --primary-hover: #FFFFFF;
    --light-bg: #0A1628;
    --card-bg: #112240;
    --text-dark: #F4F7FE;
    --text-muted: #a8b2c1;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background-color: var(--light-bg);
}

[data-theme="dark"] .navbar {
    background: rgba(10, 22, 40, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Fix navbar toggler visibility in dark mode */
[data-theme="dark"] .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .card {
    background-color: var(--card-bg) !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .table-light {
    background-color: #1a2a47 !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] thead.table-light th {
    background-color: #1a2a47 !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] tfoot.table-light td {
    background-color: #1a2a47 !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] .table {
    color: var(--text-dark) !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-nav-outline {
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .btn-nav-outline:hover {
    background: var(--primary);
    color: var(--light-bg);
}

[data-theme="dark"] .btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: var(--accent);
    color: #0A1628;
}

[data-theme="dark"] .custom-bg-primary {
    background-color: var(--accent) !important;
    color: #0A1628 !important;
}

[data-theme="dark"] .custom-text-primary {
    color: var(--accent) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea {
    background-color: #1a2a47;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-dark);
}

[data-theme="dark"] .filter-sidebar,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .medicine-card,
[data-theme="dark"] .medicine-detail-card,
[data-theme="dark"] .glass-container {
    background: rgba(10, 22, 40, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .medicine-card:hover {
    background: rgba(10, 22, 40, 0.85) !important;
    border-color: rgba(20, 197, 160, 0.4) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .medicine-card .text-muted,
[data-theme="dark"] .medicine-detail-card .text-muted {
    color: #a8b2c1 !important;
}

[data-theme="dark"] h5.card-title,
[data-theme="dark"] h2.display-5,
[data-theme="dark"] h4.mb-4,
[data-theme="dark"] h3 {
    color: #F4F7FE;
}

[data-theme="dark"] .input-group-text {
    background-color: #1a2a47 !important;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-dark) !important;
}

[data-theme="dark"] .site-footer {
    background: #050b14;
    color: rgba(255, 255, 255, 0.4);
}

/* Overrides for Dark Mode */
[data-theme="dark"] .auth-wrapper,
[data-theme="dark"] .full-page-wrapper {
    background-image: url("../images/auth_bg_dark.f0b15e6d57fc.webp");
}

[data-theme="dark"] .auth-wrapper::before,
[data-theme="dark"] .full-page-wrapper::before {
    background: rgba(10, 22, 40, 0.45);
}

[data-theme="dark"] .auth-glass-panel,
[data-theme="dark"] .glass-container {
    background: rgba(10, 22, 40, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .auth-panel-left .brand {
    color: #F4F7FE;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .auth-left-content h2,
[data-theme="dark"] .auth-feature-list li {
    color: #F4F7FE;
}

[data-theme="dark"] .auth-left-content p {
    color: #a8b2c1;
}

[data-theme="dark"] .auth-panel-right {
    background: rgba(10, 22, 40, 0.55);
    border-left-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .auth-form-box .form-control {
    background: rgba(10, 22, 40, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-nav-primary,
[data-theme="dark"] .btn-auth-submit,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success {
    color: #0A1628 !important;
}

[data-theme="dark"] .form-label,
[data-theme="dark"] .form-text,
[data-theme="dark"] .auth-form-box h1 {
    color: #F4F7FE;
}

[data-theme="dark"] .role-toggle {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .role-toggle label {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .role-toggle input[type="radio"]:checked+label {
    background: var(--accent);
    color: #0A1628;
    font-weight: 700;
}

[data-theme="dark"] .input-icon-wrap .input-icon {
    color: #a8b2c1;
}

[data-theme="dark"] ::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] .alert-success {
    background-color: rgba(20, 197, 160, 0.2) !important;
    color: #14c5a0 !important;
    border: 1px solid rgba(20, 197, 160, 0.3) !important;
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ff6b6b !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(13, 110, 253, 0.15) !important;
    color: #74c0fc !important;
    border: 1px solid rgba(13, 110, 253, 0.3) !important;
}

/* =============================================
   MOBILE RESPONSIVENESS TWEAKS
   ============================================= */
@media (max-width: 768px) {
    .card-body.p-5 {
        padding: 1.5rem !important;
    }

    .medicine-detail-card h2 {
        font-size: 1.5rem;
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .gap-2 {
        gap: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .btn-hover-transform {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

    .role-toggle {
        flex-direction: column;
    }
}