:root {
  --primary: #1a64f4;
  --primary-dark: #004ecc;
  --primary-light: #eef4ff;
  --sidebar-bg: #002d6b;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --sidebar-active: #ffffff;
  --sidebar-text: #b8c7e0;
  --bg-color: #f0f7ff;
  --white: #ffffff;
  --dark: #1e293b;
  --gray: #64748b;
  --light-gray: #f8fafc;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 30px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

/* Role Based Themes */
body.role-doctor {
  --primary: #2b59ff;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --sidebar-bg: #003183;
}

body.role-patient {
  --primary: #ee5d50;
  --primary-dark: #c53030;
  --primary-light: #fff5f5;
  --sidebar-bg: #742a2a;
}

body.role-nurse {
  --primary: #01b574;
  --primary-dark: #059669;
  --primary-light: #f0fdf4;
  --sidebar-bg: #064e3b;
}

body.role-admin {
  --primary: #ffb547;
  --primary-dark: #d97706;
  --primary-light: #fffbeb;
  --sidebar-bg: #78350f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background: var(--bg-color); color: var(--dark); min-height: 100vh; overflow-x: hidden; }

/* Global UI Elements */
#loader { position: fixed; inset: 0; background: rgba(255,255,255,0.7); backdrop-filter: blur(2px); z-index: 2000; display: none; align-items: center; justify-content: center; transition: opacity 0.2s ease; }
.spinner { width: 40px; height: 40px; border: 3px solid #f3f3f3; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast-msg { background: white; padding: 12px 24px; border-radius: 12px; box-shadow: var(--shadow); border-left: 4px solid var(--primary); font-size: 14px; animation: slideIn 0.3s ease-out; }
.toast-error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Keyframes for attractive effects */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes buttonShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* --- LOGIN PAGE EXACT DESIGN --- */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    background: url('https://img.freepik.com/free-photo/modern-hospital-building_1127-3136.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

/* Updated Login Screen Animations */
.feature-bar-left {
    animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-logo-top {
    animation: fadeInUp 0.8s ease-out both;
}

.welcome-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.welcome-sub {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.visual-content {
    animation: scaleIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.auth-card-premium {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.auth-card-premium:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 80px 180px rgba(0,0,0,0.15);
}

.btn-login-premium {
    position: relative;
    overflow: hidden;
}

.btn-login-premium::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(30deg);
    animation: buttonShine 3s infinite;
}

.security-badge-bottom {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.75), rgba(255,255,255,0.2));
    z-index: 0;
}

/* Feature Bar Far Left */
.feature-bar-left {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 30px 12px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    z-index: 10;
}

.feat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.f-icon-circle {
    width: 55px;
    height: 55px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: 0.3s;
}

.f-icon-circle:hover { transform: scale(1.1); }

.f-icon-circle.blue { background: #eef4ff; color: #1a64f4; }
.f-icon-circle.green { background: #eefdf9; color: #10b981; }
.f-icon-circle.purple { background: #f5f3ff; color: #8b5cf6; }
.f-icon-circle.red { background: #fff1f2; color: #ef4444; }

.f-label { font-size: 10px; font-weight: 800; color: #64748b; line-height: 1.1; text-transform: uppercase; }

/* Visual Content Area */
.auth-side {
    flex: 1.1;
    padding: 60px 0 60px 140px;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.auth-logo-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
}

.auth-logo-top img { width: 50px; }
.auth-logo-top .logo-text { font-weight: 850; font-size: 26px; color: #002d6b; line-height: 0.95; letter-spacing: -0.5px; }
.auth-logo-top .logo-text span { display: block; font-weight: 600; font-size: 15px; color: #10b981; margin-top: 5px; }

.welcome-title { font-size: 120px; font-weight: 900; color: white; line-height: 0.8; margin-bottom: 25px; text-shadow: 10px 10px 0px rgba(0,0,0,0.02); letter-spacing: -6px; }
.welcome-title span { display: block; color: #10b981; }
.welcome-sub { font-size: 22px; color: #475569; max-width: 420px; margin-bottom: 50px; font-weight: 600; line-height: 1.4; }

.visual-content {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 50px;
}

.character-platform {
    width: 480px;
    height: 120px;
    background: white;
    border-radius: 50%;
    transform: rotateX(75deg);
    box-shadow: 0 40px 100px rgba(0,0,0,0.2), inset 0 0 40px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
    animation: platformGlow 4s ease-in-out infinite;
}

@keyframes platformGlow {
    0%, 100% { box-shadow: 0 40px 100px rgba(0,0,0,0.2), inset 0 0 40px rgba(0,0,0,0.05); }
    50% { box-shadow: 0 40px 120px rgba(26,100,244,0.3), inset 0 0 60px rgba(26,100,244,0.1); }
}

.vignesh-character {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    height: 750px;
    z-index: 2;
    filter: drop-shadow(20px 20px 50px rgba(0,0,0,0.2));
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: characterEntrance 1.2s ease-out forwards, characterFloat 4s ease-in-out infinite 1.2s;
}

@keyframes characterEntrance {
    from { opacity: 0; transform: translateX(-50%) translateY(50px) scale(0.9); filter: blur(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); filter: blur(0); }
}

@keyframes characterFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-15px); }
}

.vignesh-character:hover { transform: translateX(-50%) translateY(-25px) scale(1.05); filter: drop-shadow(30px 30px 60px rgba(26,100,244,0.3)); }

.potted-plant {
    position: absolute;
    bottom: 140px;
    left: 420px;
    width: 200px;
    z-index: 3;
    filter: drop-shadow(15px 15px 30px rgba(0,0,0,0.1));
}

/* Right Form Wrap */
.auth-form-wrap {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-right: 80px;
    z-index: 2;
}

.auth-card-premium {
    background: white;
    width: 100%;
    max-width: 520px;
    border-radius: 70px;
    padding: 70px 55px;
    box-shadow: 0 60px 150px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

.card-3d-heart {
    width: 130px;
    height: 130px;
    background: white;
    border-radius: 50%;
    margin: -135px auto 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.08);
    border: 10px solid #f0f7ff;
}

.card-3d-heart img { width: 70px; }

.auth-card-premium h2 { font-size: 48px; font-weight: 850; color: #1e293b; margin-bottom: 10px; letter-spacing: -1.5px; }
.auth-card-premium .subtext { font-size: 18px; color: #94a3b8; margin-bottom: 45px; font-weight: 600; }

.premium-form label { display: block; text-align: left; font-size: 16px; font-weight: 800; color: #334155; margin-bottom: 12px; padding-left: 8px; }
.input-premium-wrap { position: relative; margin-bottom: 28px; }
.input-premium-wrap .icon { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); color: #1a64f4; font-size: 22px; }
.input-premium-wrap input {
    width: 100%;
    padding: 20px 20px 20px 65px;
    border-radius: 25px;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    font-size: 16px;
    font-family: inherit;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    font-weight: 500;
}

.input-premium-wrap input:focus { outline: none; border-color: #1a64f4; background: white; box-shadow: 0 15px 35px rgba(26,100,244,0.1); transform: translateY(-2px); }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 35px; padding: 0 8px; }
.check-premium { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: #475569; cursor: pointer; }
.check-premium input { width: 24px; height: 24px; accent-color: #1a64f4; border-radius: 8px; cursor: pointer; }
.forgot-premium { font-size: 15px; font-weight: 800; color: #1a64f4; text-decoration: none; }

.btn-login-premium {
    width: 100%;
    background: linear-gradient(135deg, #1a64f4 0%, #004ecc 100%);
    color: white;
    height: 70px;
    border-radius: 25px;
    border: none;
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(26,100,244,0.35);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-login-premium:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 30px 60px rgba(26,100,244,0.45); }
.btn-login-premium .arrow-icon { font-size: 26px; margin-left: 10px; transition: 0.3s; }
.btn-login-premium:hover .arrow-icon { transform: translateX(8px); }

.premium-divider { margin: 40px 0; position: relative; }
.premium-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 2px; background: #f1f5f9; }
.premium-divider span { position: relative; background: white; padding: 0 25px; color: #94a3b8; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.premium-social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 45px; }
.btn-soc {
    background: white; border: 2px solid #f1f5f9; height: 65px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: 17px; font-weight: 800; color: #334155; cursor: pointer; transition: 0.3s;
}
.btn-soc:hover { background: #f8fafc; border-color: #e2e8f0; transform: translateY(-3px); }

.auth-footer-text { font-size: 17px; color: #64748b; font-weight: 700; }
.auth-footer-text a { color: #10b981; font-weight: 900; text-decoration: none; margin-left: 5px; }

/* Security Badge Bottom Right */
.security-badge-bottom {
    margin-top: 50px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 20px 35px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.5);
    align-self: flex-end;
}

.security-badge-bottom .s-icon { width: 50px; height: 50px; border-radius: 15px; background: #eefdf9; color: #10b981; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.security-badge-bottom .s-content { text-align: left; }
.security-badge-bottom strong { display: block; font-size: 15px; color: #1e293b; font-weight: 800; }
.security-badge-bottom span { font-size: 13px; color: #64748b; font-weight: 500; }

/* --- AI CHATBOT STYLES --- */
#ai-chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
}

#ai-chat-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #1a64f4 0%, #004ecc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(26,100,244,0.4);
    position: relative;
    transition: 0.3s;
}

#ai-chat-icon:hover { transform: scale(1.1) rotate(5deg); }

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(26,100,244,0.3);
    animation: ring-pulse 2s infinite;
}

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

#ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 480px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chat-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chat-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    background: #1a64f4;
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

#close-chat {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.ai-msg, .user-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.5;
}

.ai-msg {
    background: white;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.02);
}

.user-msg {
    background: #1a64f4;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 5px 15px rgba(26,100,244,0.2);
}

.chat-input-area {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: white;
    border-top: 1px solid #f1f5f9;
}

#ai-chat-input {
    flex: 1;
    border: none;
    background: #f1f5f9;
    padding: 12px 15px;
    border-radius: 15px;
    outline: none;
    font-size: 13px;
}

#send-ai-chat {
    width: 40px;
    height: 40px;
    background: #1a64f4;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#send-ai-chat:hover { background: #004ecc; }

body.dark-mode #ai-chat-window { background: #111c44; }
body.dark-mode #ai-chat-messages { background: #0b1437; }
body.dark-mode .ai-msg { background: #1b254b; color: white; }
body.dark-mode #ai-chat-input { background: #1b254b; color: white; }

.card-icon-top {
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: 50%;
    margin: -120px auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    border: 8px solid #f0f7ff;
}

.card-icon-top img { width: 60px; }

.auth-card-exact h2 { font-size: 42px; font-weight: 800; color: #1e293b; margin-bottom: 8px; letter-spacing: -1px; }
.auth-card-exact .subtext { font-size: 16px; color: #94a3b8; margin-bottom: 45px; font-weight: 500; }

.exact-form { text-align: left; }
.exact-form label { font-size: 15px; font-weight: 700; color: #334155; margin-bottom: 12px; display: block; padding-left: 5px; }
.input-wrap-exact { position: relative; margin-bottom: 25px; }
.input-wrap-exact .icon { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 20px; }
.input-wrap-exact input {
    width: 100%;
    padding: 18px 20px 18px 60px;
    border-radius: 22px;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    font-size: 15px;
    font-family: inherit;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
}

.input-wrap-exact input::placeholder { color: #cbd5e1; }
.input-wrap-exact input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 15px 30px rgba(26,100,244,0.08); }

.form-footer-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 35px; padding: 0 5px; }
.check-exact { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #475569; cursor: pointer; }
.check-exact input { width: 22px; height: 22px; border-radius: 7px; cursor: pointer; accent-color: var(--primary); }
.forgot-exact { font-size: 14px; font-weight: 700; color: var(--primary); text-decoration: none; }

.btn-login-exact {
    width: 100%;
    background: linear-gradient(135deg, #1a64f4 0%, #004ecc 100%);
    color: white;
    height: 65px;
    border-radius: 22px;
    border: none;
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(26,100,244,0.3);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-login-exact:hover { transform: translateY(-5px); box-shadow: 0 25px 50px rgba(26,100,244,0.4); }
.btn-login-exact span { font-size: 24px; transition: 0.3s; }
.btn-login-exact:hover span { transform: translateX(5px); }

.divider-exact { margin: 35px 0; position: relative; text-align: center; }
.divider-exact::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #f1f5f9; }
.divider-exact span { position: relative; background: #fff; padding: 0 20px; color: #94a3b8; font-size: 13px; font-weight: 500; }

.social-btns-exact { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 45px; }
.btn-social-exact {
    background: #fff;
    border: 2px solid #f1f5f9;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: 0.3s;
}
.btn-social-exact:hover { background: #f8fafc; border-color: #e2e8f0; transform: translateY(-2px); }

.bottom-badge-exact {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 18px 30px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.5);
}

.bottom-badge-exact .b-icon { width: 45px; height: 45px; border-radius: 14px; background: #eefdf9; color: #10b981; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.bottom-badge-exact .b-text { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.bottom-badge-exact .b-text span { display: block; font-weight: 500; color: #64748b; margin-top: 3px; font-size: 12px; }

/* Responsive Auth */
@media (max-width: 992px) {
    .auth-side { display: none; }
    .auth-form-wrap { flex: 1; }
}

/* Register Screen */
.register-container {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    min-height: 100vh; width: 100vw; display: flex; justify-content: center;
    align-items: center; padding: 60px 20px; overflow-y: auto;
}

.register-card-premium {
    background: white;
    width: 100%;
    max-width: 950px;
    border-radius: 60px;
    padding: 60px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.08);
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-tabs-premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.role-tab-premium { cursor: pointer; }
.role-tab-premium input { display: none; }

.role-content-premium {
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 20px;
    padding: 20px 10px;
    text-align: center;
    transition: 0.3s;
}

.role-tab-premium input:checked + .role-content-premium {
    border-color: var(--primary);
    background: #f0f7ff;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(26,100,244,0.08);
}

.icon-box-premium { font-size: 28px; margin-bottom: 10px; }
.role-label-premium { font-size: 14px; font-weight: 800; color: #334155; }
.role-tab-premium input:checked + .role-content-premium .role-label-premium { color: var(--primary); }

.register-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .register-grid { grid-template-columns: 1fr; }
    .role-tabs-premium { grid-template-columns: 1fr 1fr; }
    .register-card-premium { padding: 40px 30px; border-radius: 40px; }
}

/* App Layout */
.app-container { display: flex; height: 100vh; width: 100vw; overflow: hidden; }
.sidebar { width: 280px; background: var(--sidebar-bg); color: white; display: flex; flex-direction: column; transition: 0.3s; z-index: 100; }
.sidebar .brand { padding: 40px 30px; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.sidebar nav { flex: 1; padding: 0 20px; overflow-y: auto; }
.sidebar nav a {
    display: flex; align-items: center; gap: 15px; padding: 14px 20px;
    border-radius: 15px; color: var(--sidebar-text); text-decoration: none;
    font-size: 14px; font-weight: 500; margin-bottom: 8px; transition: 0.2s;
}
.sidebar nav a.active { background: rgba(255, 255, 255, 0.1); color: white; font-weight: 600; }
.sidebar nav a:hover { color: white; background: var(--sidebar-hover); }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 80px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; background: transparent; flex-shrink: 0;
}
.content-area { flex: 1; padding: 20px 40px 40px; overflow-y: auto; background: var(--bg-color); }

/* Forms & Buttons */
.form-group { margin-bottom: 20px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 8px; display: block; }
.input-with-icon { position: relative; }
.input-with-icon .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 18px; }
.form-control {
    width: 100%; padding: 12px 15px 12px 45px; border-radius: 14px;
    border: 1px solid #e2e8f0; font-family: inherit; font-size: 14px;
    transition: 0.3s; background: #fff; color: var(--dark);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 89, 255, 0.1); }

.btn {
    padding: 12px 20px; border-radius: 14px; border: none; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; transition: 0.3s;
}
.btn-primary { background: var(--primary); color: white; width: 100%; justify-content: center; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; border: 1px solid #e2e8f0; color: var(--dark); width: 100%; justify-content: center; margin-top: 12px; }
.btn-outline:hover { background: #f8fafc; }
.btn-ghost { background: transparent; border: 1px solid #e2e8f0; color: var(--gray); }
.btn-ghost:hover { background: #fff; color: var(--primary); border-color: var(--primary); }

.divider { display: flex; align-items: center; text-align: center; margin: 25px 0; color: var(--gray); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #e2e8f0; }
.divider:not(:empty)::before { margin-right: 15px; }
.divider:not(:empty)::after { margin-left: 15px; }

/* UI Elements */
.badge { padding: 6px 12px; border-radius: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-success { background: #e6f7ef; color: #01b574; }
.badge-warning { background: #fff8eb; color: #ffb547; }
.badge-danger { background: #fdf2f2; color: #ee5d50; }

.panel { background: white; border-radius: 20px; padding: 25px; box-shadow: var(--shadow); margin-bottom: 24px; border: none; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { display: flex; align-items: center; gap: 20px; background: white; padding: 20px; border-radius: 20px; box-shadow: var(--shadow); }
.stat-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
/* Emergency SOS Pulse Effect */
.sos-btn {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 0 0 0 rgba(238, 93, 80, 0.7);
    transition: all 0.3s ease;
    animation: pulse-red 2s infinite;
}
.sos-btn:active {
    transform: scale(0.9);
    animation: none;
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(238, 93, 80, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 20px rgba(238, 93, 80, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(238, 93, 80, 0); }
}

/* Header Action Buttons */
.icon-btn-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f4f7fe;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
}
.icon-btn-header:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}
body.dark-mode .icon-btn-header {
    background: #1b254b;
    color: white;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 15px; color: var(--gray); font-weight: 600; font-size: 12px; border-bottom: 1px solid #f1f5f9; }
.data-table td { padding: 15px; font-size: 14px; border-bottom: 1px solid #f1f5f9; }

/* Dark mode */
body.dark-mode { --bg-color: #0b1437; --white: #111c44; --dark: #ffffff; --shadow: none; }
body.dark-mode .panel, body.dark-mode .stat-card, body.dark-mode .auth-card, body.dark-mode .register-card { background: #111c44; }
body.dark-mode .form-control { background: #1b254b; border-color: #2b3674; color: white; }
body.dark-mode .topbar { background: transparent; }
body.dark-mode .content-area { background: #0b1437; }
body.dark-mode .data-table th, body.dark-mode .data-table td { border-bottom-color: #2b3674; }

/* Page View Visibility */
.page-view { display: none; animation: fadeIn 0.4s ease-out; }
.page-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-content { max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }

/* Appointments Page Specific Styles */
.stat-card-mini { background: white; border-radius: 15px; padding: 20px; display: flex; align-items: center; gap: 15px; box-shadow: var(--shadow); }
.stat-icon-mini { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-info-mini { display: flex; flex-direction: column; }
.stat-val-mini { font-size: 20px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-label-mini { font-size: 11px; color: var(--gray); font-weight: 600; text-transform: uppercase; margin-top: 4px; }

.appt-tabs { display: flex; gap: 30px; border-bottom: 1px solid #e2e8f0; margin-bottom: 25px; padding-left: 10px; }
.appt-tab { padding: 12px 5px; font-size: 14px; font-weight: 600; color: var(--gray); cursor: pointer; position: relative; }
.appt-tab.active { color: var(--primary); }
.appt-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--primary); }

.appt-filters { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; gap: 20px; }
.form-control-sm { padding: 8px 12px; border-radius: 10px; border: 1px solid #e2e8f0; font-size: 12px; font-family: inherit; outline: none; background: white; color: var(--dark); }
.search-bar-sm { position: relative; display: flex; align-items: center; }
.search-bar-sm span { position: absolute; left: 12px; color: var(--gray); font-size: 14px; }
.search-bar-sm input { padding: 8px 12px 8px 35px; border-radius: 10px; border: 1px solid #e2e8f0; font-size: 12px; width: 220px; outline: none; background: white; color: var(--dark); }
.btn-icon-filter { background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 15px; font-size: 11px; font-weight: 700; color: var(--primary); cursor: pointer; }

.appt-card-v2 { background: white; border-radius: 20px; padding: 20px; display: flex; gap: 25px; margin-bottom: 20px; box-shadow: var(--shadow); transition: 0.3s; }
.appt-card-v2:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.appt-doc-info { display: flex; gap: 20px; width: 45%; }
.doc-img-lg { width: 70px; height: 70px; border-radius: 15px; object-fit: cover; }
.doc-name-v2 { font-size: 16px; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 5px; }
.verified-tick { color: var(--primary); font-size: 12px; }
.doc-spec-v2 { font-size: 12px; color: var(--gray); font-weight: 600; }
.doc-dept-v2 { font-size: 11px; color: var(--gray); margin-top: 2px; }
.appt-reason { font-size: 12px; color: var(--dark); margin-top: 10px; background: #f8fafc; padding: 5px 12px; border-radius: 8px; display: inline-block; }

.appt-time-info { width: 30%; border-left: 1px solid #f1f5f9; padding-left: 25px; display: flex; flex-direction: column; justify-content: center; gap: 15px; }
.appt-date-box, .appt-time-box { display: flex; align-items: center; gap: 12px; }
.appt-date-box span, .appt-time-box span { font-size: 18px; color: var(--primary); }
.date-v2, .time-v2 { font-size: 14px; font-weight: 700; color: var(--dark); }
.day-v2, .duration-v2 { font-size: 11px; color: var(--gray); }

.appt-actions-v2 { flex: 1; border-left: 1px solid #f1f5f9; padding-left: 25px; display: flex; flex-direction: column; align-items: flex-end; }
.btn-ghost-sm { background: #f8fafc; border: none; padding: 8px 15px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--dark); cursor: pointer; }
.btn-outline-danger-sm { background: white; border: 1px solid #fee2e2; padding: 8px 15px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--danger); cursor: pointer; }
.btn-primary-sm { background: var(--primary); border: none; padding: 8px 15px; border-radius: 10px; font-size: 11px; font-weight: 600; color: white; cursor: pointer; }

.appt-pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 30px; }
.btn-page { width: 35px; height: 35px; border-radius: 10px; border: 1px solid #e2e8f0; background: white; color: var(--gray); font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-page:first-child, .btn-page:last-child { width: auto; padding: 0 15px; }
.btn-page.active { background: var(--primary); color: white; border-color: var(--primary); }

.calendar-panel { padding: 20px; border-radius: 20px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 14px; }
.btn-today { padding: 4px 12px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 11px; font-weight: 600; color: var(--dark); cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; font-size: 11px; }
.calendar-grid div { padding: 8px 0; border-radius: 8px; color: var(--dark); font-weight: 500; }
.calendar-grid div:nth-child(-n+7) { color: var(--gray); font-weight: 600; margin-bottom: 5px; }
.day-muted { color: #cbd5e1 !important; }
.day-active { background: var(--primary); color: white !important; font-weight: 700 !important; }

.time-slots-header { font-size: 13px; font-weight: 700; color: var(--dark); margin: 25px 0 15px; }
.time-slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-slot-v2 { padding: 8px; border-radius: 10px; border: 1px solid #e2e8f0; background: white; font-size: 10px; font-weight: 600; color: var(--dark); cursor: pointer; transition: 0.2s; }
.time-slot-v2:hover { border-color: var(--primary); color: var(--primary); }
.time-slot-v2.selected { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(43, 89, 255, 0.3); }

.appt-features-footer { display: flex; justify-content: space-between; margin-top: 40px; padding: 25px; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.feature-item-v2 { display: flex; gap: 15px; align-items: flex-start; max-width: 220px; }
.feat-icon-v2 { width: 35px; height: 35px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.feat-title-v2 { font-size: 13px; font-weight: 700; color: var(--dark); }
.feat-desc-v2 { font-size: 10px; color: var(--gray); margin-top: 3px; line-height: 1.4; }

/* Dark mode overrides for new components */
body.dark-mode .stat-card-mini,
body.dark-mode .appt-card-v2,
body.dark-mode .appt-features-footer,
body.dark-mode .form-control-sm,
body.dark-mode .search-bar-sm input,
body.dark-mode .calendar-panel,
body.dark-mode .time-slot-v2 { background: #111c44; color: white; border-color: #2b3674; }
body.dark-mode .doc-name-v2, body.dark-mode .appt-reason, body.dark-mode .date-v2, body.dark-mode .time-v2, body.dark-mode .feat-title-v2 { color: white; }
body.dark-mode .appt-reason { background: #1b254b; }
body.dark-mode .day-muted { color: #475569 !important; }
body.dark-mode .btn-today, body.dark-mode .btn-icon-filter, body.dark-mode .btn-page { background: #1b254b; color: white; border-color: #2b3674; }
body.dark-mode .btn-ghost-sm { background: #1b254b; color: white; }

/* --- RESPONSIVE DESIGN --- */

@media (max-width: 1400px) {
    .welcome-title { font-size: 100px; }
    .vignesh-character { height: 700px; }
}

@media (max-width: 1200px) {
    .auth-side { padding: 50px 40px; }
    .welcome-title { font-size: 80px; letter-spacing: -3px; }
    .vignesh-character { height: 600px; }
    .auth-form-wrap { padding-right: 40px; }
}

@media (max-width: 992px) {
    .auth-container { flex-direction: column; overflow-y: auto; }
    .auth-side { display: none; }
    .auth-form-wrap { flex: 1; padding: 60px 20px; width: 100%; justify-content: center; align-items: center; }
    .auth-card-premium { border-radius: 40px; padding: 50px 30px; }
    .card-3d-heart { width: 100px; height: 100px; margin-top: -100px; }
    .feature-bar-left { display: none; }
    .security-badge-bottom { position: relative; bottom: 0; right: 0; margin: 20px auto 0; align-self: center; }

    /* App Layout Mobile */
    .sidebar {
        position: fixed;
        left: -285px;
        top: 0;
        height: 100vh;
        z-index: 2000;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.active { left: 0; }
    .topbar { padding: 0 20px; gap: 10px; }
    .topbar .breadcrumb { display: none; }
    .content-area { padding: 20px; }

    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

    .stat-card { padding: 15px; }
    .stat-icon { width: 45px; height: 45px; font-size: 20px; }

    .appt-actions-v2 { padding-left: 0; border-left: none; margin-top: 15px; align-items: flex-start; }
    .appt-card-v2 { flex-direction: column; gap: 15px; }
    .appt-doc-info, .appt-time-info { width: 100%; border-left: none; padding-left: 0; }
}

@media (max-width: 480px) {
    .auth-card-premium h2 { font-size: 32px; }
    .auth-card-premium .subtext { font-size: 14px; }
    .btn-login-premium { height: 60px; font-size: 18px; }
    .premium-social-btns { grid-template-columns: 1fr; gap: 10px; }
    .btn-soc { height: 55px; }

    .topbar > div:last-child { padding: 5px 15px !important; gap: 10px !important; width: 100%; justify-content: space-between; }
    .search-bar { display: none; }

    .page-title { font-size: 20px; }
}

/* Scrollable Tables on Mobile */
.panel { overflow-x: auto; }
.data-table { min-width: 600px; }

/* Mobile Sidebar Toggle Button */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: var(--shadow);
    color: var(--primary);
    transition: 0.3s;
}

.menu-toggle:active { transform: scale(0.9); }

@media (max-width: 992px) {
    .menu-toggle { display: flex; }
}

body.dark-mode .menu-toggle { background: #1b254b; color: white; }
