/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #E0F2FE;
    --secondary-color: #06B6D4;
    --accent-color: #F97316;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-light: #64748B;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-accent: #F1F5F9;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --footer-bg: #0F172A;
    --footer-text: #F8FAFC;
    --footer-text-secondary: rgba(248, 250, 252, 0.7);
    
    /* New gradient variables */
    --gradient-primary: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%);
    --gradient-secondary: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    --gradient-bg: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #60A5FA;
    --primary-dark: #3B82F6;
    --primary-light: #1E3A8A;
    --secondary-color: #34D399;
    --accent-color: #FBBF24;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-light: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-accent: #374151;
    --border-color: #374151;
    --border-light: #4B5563;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --footer-bg: #0F172A;
    --footer-text: #F1F5F9;
    --footer-text-secondary: rgba(241, 245, 249, 0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    animation: loaderOut 1.4s ease 0.6s forwards; /* total ~2.0s */
}

#loading-screen::before,
#loading-screen::after { display: none; }

.loader {
    text-align: center;
    color: white;
    padding: 12px 16px;
}

.pulse { display: none; }

.loader span {
    font-size: 24px;
    font-weight: 600;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Enhanced Loader UI */
.loader-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.loader-logo {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.loader-logo::before {
    content: '';
    position: absolute;
    inset: -10px; /* creates a ring around 48px icon */
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    animation: rotate360 0.9s linear infinite;
}

.loader-logo i { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }

.loader-title { font-size: 18px; font-weight: 700; letter-spacing: 0.3px; margin-top: 10px; }

.loader-progress { display: none; }

.loader-bar-wrap, #loader-bar { display: none; }

.loader-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0.9;
}

#loader-percent {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.loader-tip { display: none; }

/* Loader animations */
@keyframes rotate360 { to { transform: rotate(360deg); } }
@keyframes loaderOut { 0% { opacity: 1; } 80% { opacity: 0; } 100% { opacity: 0; visibility: hidden; } }

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .pulse { animation: none; }
    .loader-logo::before { animation: none; }
    #loading-screen { animation: loaderOut 0.01s linear 0.2s forwards; }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary * {
    position: relative;
    z-index: 2;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-accent);
}

.btn-block {
    width: 100%;
}

.btn-search {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.form-control:disabled {
    background-color: var(--bg-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Error states */
.form-control.error,
.form-control:invalid.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group .error-message {
    color: #EF4444;
    font-size: 12px;
    margin-top: 6px;
}

/* Textarea specific styles */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

/* Select specific styles */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Input group with textarea */
.input-group textarea.form-control {
    padding-left: 48px;
    padding-top: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-options {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 2;
    font-size: 16px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .form-control {
    padding-left: 48px;
    padding-right: 44px;
    position: relative;
    z-index: 1;
}

.input-group .password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    z-index: 2;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .password-toggle i {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    font-size: 16px;
    pointer-events: none;
}

.input-group .password-toggle:hover {
    color: var(--primary-color);
    background: var(--bg-accent);
}

/* Header */
.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

/* Header background for light mode */
:root .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

/* Header background for dark mode */
[data-theme="dark"] .header.scrolled {
    background: rgba(17, 24, 39, 0.95);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 45px;
    width: 45px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(14, 165, 233, 0.15);
    transition: var(--transition);
}

.logo-text:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.logo-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    -webkit-text-fill-color: initial;
    background: none;
    text-shadow: none;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text .brand-left,
.logo-text .brand-right,
.logo-text .logo-letter {
    color: var(--text-primary);
    font-weight: 800;
}

.logo-text .brand-right {
    color: var(--primary-dark);
}

/* Urdu brand rendering */
.logo-text .brand-ur,
.footer-logo-text .brand-ur {
    font-weight: 800;
    color: var(--text-primary);
    direction: rtl;
    unicode-bidi: isolate;
    font-variant-ligatures: none;
    -webkit-font-variant-ligatures: none;
    font-feature-settings: 'liga' 0, 'rlig' 0, 'calt' 0;
    text-decoration: none;
    display: inline-block;
}

.logo-text .logo-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

/* Stylized 'a' with medical icon inside */
.logo-text .logo-letter.logo-a {
    position: relative;
    display: inline-block;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin: 0; /* no side spacing */
}

/* Inner counter circle */
.logo-text .logo-letter.logo-a::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    
    top: 0.34em; /* lower to avoid showing above the bowl */
    left: 0.34em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Medical icon inside the counter */
.logo-text .logo-letter.logo-a i {
    position: absolute;
    top: 0.34em; /* align with inner circle */
    left: 0.34em;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px; /* smaller so no part sticks out */
    color: #fff;
    pointer-events: none;
}

/* Fine-tune baseline and spacing */
.logo-text .brand-left { margin-right: 0; }
.logo-text .brand-right { margin-left: 0; }

.footer-logo-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--footer-text);
    margin: 0 0 1rem 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

.footer .footer-logo-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer .footer-logo-text .brand-left,
.footer .footer-logo-text .brand-right {
    color: var(--footer-text);
}

.footer .footer-logo-text .logo-pill {
    background: var(--accent-color);
    color: #fff;
}

/* Footer contrast for stylized 'a' */
.footer .footer-logo-text .logo-letter.logo-a { color: var(--footer-text); }
.footer .footer-logo-text .logo-letter.logo-a::after { background: var(--accent-color); }
.footer .footer-logo-text .logo-letter.logo-a i { color: #fff; }

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--bg-accent);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 18px;
    transition: var(--transition);
}

.theme-toggle:hover i {
    color: var(--primary-color);
}

/* Auth Buttons Container */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Signup Dropdown */
.signup-dropdown {
    position: relative;
    display: inline-block;
}

.signup-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
}

.signup-dropdown:hover .signup-dropdown-menu,
.signup-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--radius-md);
    margin: 4px;
}

.dropdown-item:hover {
    background: var(--bg-accent);
    color: var(--primary-color);
}

.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
    display: inline-block;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-profile-btn:hover {
    background: var(--bg-accent);
}

.user-profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
}

.user-profile-dropdown:hover .user-profile-menu,
.user-profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    font-size: 32px;
    color: var(--primary-color);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.user-type {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Auth Pages Styles */
.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-accent) 100%);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 600px;
}

.auth-container.register-container {
    max-width: 1400px;
}

.auth-card {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.register-card {
    padding: 30px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .register-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step span {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.step.active span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-step h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-accent);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.file-upload-content p {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-upload-content span {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-preview, .photo-preview {
    margin-top: 15px;
    display: none;
}

.photo-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--text-primary);
}

/* Availability Grid */
.availability-grid {
    display: grid;
    gap: 15px;
}

.day-availability {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-inputs input[type="time"] {
    flex: 1;
}

.time-inputs span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Checkbox Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Auth Image */
.auth-image {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
}

.auth-image-content {
    text-align: center;
}

.auth-image-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.auth-image-content p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.auth-features {
    display: grid;
    gap: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.feature i {
    font-size: 20px;
    opacity: 0.8;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-switch p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Responsive Design for Auth Pages */
@media (max-width: 768px) {
    .auth-main {
        padding: 80px 15px 20px;
        align-items: flex-start;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
        margin: 0;
        margin-top: 20px;
        min-height: auto;
    }
    
    .auth-image {
        order: -1;
        padding: 30px 20px;
        min-height: 200px;
    }
    
    .auth-card, .register-card {
        padding: 30px 20px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step {
        flex: 1;
        min-width: 80px;
    }
    
    .day-availability {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .time-inputs {
        justify-content: center;
    }
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* Mobile Navigation (drawer) */
.nav.mobile-open {
    display: block;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.25s ease;
    z-index: 999;
}

.nav.mobile-open .nav-list {
    flex-direction: column;
    gap: 0;
}

.nav.mobile-open .nav-list li {
    border-bottom: 1px solid var(--border-light);
}

.nav.mobile-open .nav-list a {
    display: block;
    padding: 16px 20px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hamburger to X animation */
.mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* Main Content */
.main {
    margin-top: 72px;
}

.page-section {
    display: none;
    min-height: calc(100vh - 72px);
}

.page-section.active {
    display: block;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
}

.hero-content {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr; 
    gap: 24px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text { max-width: 720px; }

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.12;
    margin-bottom: 16px;
    max-width: 26ch; /* tuned to approx 2 lines on desktop */
    text-wrap: balance; /* nicer two-line balance where supported */
    font-variant-ligatures: none;
    -webkit-font-variant-ligatures: none;
    font-feature-settings: 'liga' 0, 'rlig' 0, 'calt' 0;
    text-decoration: none;
}

/* Remove any decorative separator around hero title parts (fix Urdu dash line) */
.hero-title .text-primary::after,
.hero-title .text-primary::before,
.hero-title [data-translate="heroTitle"]::before,
.hero-title [data-translate="heroTitle"]::after {
    content: none !important;
}
.hero-title .text-primary,
.hero-title [data-translate="heroTitle"] {
    border: 0 !important;
    text-decoration: none !important;
}

/* Keep brand word isolated to avoid RTL/LTR shaping inserting separators */
.hero-title .text-primary { display: inline-block; }

/* Ensure the word "Tabeeb" in the hero heading stays highly visible over the background */
.hero .hero-title .text-primary {
    color: #fff;
}

@media (max-width: 1200px) {
    .hero-content { grid-template-columns: 1fr; }
    .hero-text { max-width: 100%; }
    .hero-title { font-size: 2.25rem; max-width: 100%; }
}

@media (max-width: 992px) {
    .hero-title { font-size: 2rem; max-width: 100%; }
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.search-box {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-bottom: 40px;
}

.search-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Hero Image */
.hero-image {
    position: relative;
    height: 500px;
}

.hero-illustration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.main-doctor {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
}

.floating-cards {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.floating-card {
    position: absolute;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: -1s;
}

.card-2 {
    bottom: 8%;
    right: 10%;
    animation-delay: -2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.doctor-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doctor-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.doctor-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.doctor-info p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.rating i {
    color: #FFC107;
    font-size: 12px;
}

.rating span {
    font-size: 12px;
    font-weight: 600;
}

.appointment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top:10px;
}

.appointment-icon {
    width: 48px;
    height: 48px;
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.appointment-text h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.appointment-text p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

/* Section Header */
.section-header {
    text-align: left;
    margin-bottom: 60px;
}

/* Stack title and subtitle explicitly to prevent inline layout issues */
.section-header h2,
.section-header p {
    display: block;
}

/* RTL alignment */
body.rtl .section-header {
    text-align: right;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Features Section */
.features-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

/* Center align header for Features section ("Why Choose Tabeeb?") */
.features-section .section-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.features-section .section-header::after {
    content: '';
    display: block;
    clear: both;
}

.features-section .section-header h2,
.features-section .section-header p {
    display: block !important;
    width: 100%;
}

/* Center and stack headers for Services (Your Appointments) and Blogs (Health Tips & Articles) */
#services .section-header,
#blogs .section-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#services .section-header h2,
#services .section-header p,
#blogs .section-header h1,
#blogs .section-header p {
    display: block !important;
    width: 100%;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.feature-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    margin-bottom: 16px;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Specialties Section */
.specialties-section {
    padding: 100px 0;
}

/* Center align header for Specialties section ("Popular Specialties") */
.specialties-section .section-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.specialties-section .section-header h2,
.specialties-section .section-header p {
    display: block;
    width: 100%;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.specialty-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
}

.specialty-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.specialty-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.specialty-card h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.specialty-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.doctor-count {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Doctors Section */
#doctors {
    padding: 40px 0 100px;
    background: var(--bg-secondary);
}

.doctors-header {
    text-align: center;
    margin-bottom: 60px;
}

.doctors-header h1 {
    margin-bottom: 16px;
}

.doctors-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.doctors-filters {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    min-width: 200px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.doctor-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
}

.doctor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.doctor-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  flex: 0 0 auto;
}

.doctor-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.doctor-avatar-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.doctor-details h3 {
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.doctor-specialty {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.doctor-experience {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.doctor-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: #FFC107;
    font-size: 14px;
}

.rating-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.doctor-body {
  padding: 24px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.doctor-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-item i {
    color: var(--primary-color);
}

.doctor-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  align-items: center;
}

.btn-book {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-book:hover {
    background: var(--primary-dark);
}

.btn-video {
    background: var(--secondary-color);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-video:hover {
    background: #059669;
}

/* Services Section */
#services {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.service-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-card.featured {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.service-card.featured .service-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
    color: var(--primary-color);
}

.service-card h3 {
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.service-card p {
    margin-bottom: 20px;
    font-size: 1.125rem;
}

.service-card.featured p {
    color: rgba(255, 255, 255, 0.9);
}

.service-card ul {
    list-style: none;
    text-align: left;
}

.service-card li {
    padding: 8px 0;
    position: relative;
    padding-left: 24px;
}

.service-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.service-card.featured li::before {
    color: rgba(255, 255, 255, 0.8);
}

/* Blogs Section */
#blogs {
    padding: 100px 0;
}

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.blog-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.blog-image, .blog-icon {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.blog-content {
    padding: 24px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Clamp blog descriptions to 2 lines with ellipsis for both dynamic (.blog-excerpt)
   and static cards that use a simple paragraph in blog content */
.blog-card .blog-excerpt,
.blog-card .blog-content p,
.blogs-grid .blog-card > p {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--primary-dark);
}

/* Contact Section */
#contact {
    padding: 100px 0;
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-details {
    margin-top: 40px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-text h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.contact-text p {
    color: var(--text-secondary);
    margin: 0;
}

.contact-form {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.contact-form h3 {
    margin-bottom: 32px;
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-content {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 24px;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.05), inset 0 1px 0 rgba(255,255,255,0.1);
    width: 95vw;
    max-width: 960px;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    padding: 40px;
}

.modal-large .modal-content {
    max-width: 1000px;
    width: 95%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 32px 0;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.modal-body {
    padding: 0 32px 32px;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

/* Blog (Health Tips) Modal – more readable article layout */
.blog-modal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
}

.blog-modal .modal-header {
    padding: 24px 32px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.blog-modal #blogModalTitle {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    padding-right: 40px;
}

.blog-modal .modal-body {
    padding: 0 32px 32px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.7;
}

.blog-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.blog-modal .modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.blog-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.blog-modal .modal-body p {
    margin-bottom: 1rem;
}

.blog-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 0 16px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
}

.blog-hero .hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.blog-hero-meta {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
}

.blog-hero-meta .badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--primary-color);
}

.blog-hero-meta .date-info {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-hero-meta .date-info i {
    color: var(--primary-color);
}

.blog-article {
    padding: 16px 0 8px;
}

.blog-article p {
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.blog-article h2,
.blog-article h3,
.blog-article h4 {
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.4;
}

.blog-article h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
}

.blog-article h3 {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.blog-article h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
}
.blog-article ul,
.blog-article ol {
    margin: 1rem 0;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.blog-article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.blog-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-article em {
    color: var(--text-light);
    font-style: italic;
}

/* RTL Support for Blog Modal */
[dir="rtl"] .blog-modal .modal-body {
    text-align: right;
}

[dir="rtl"] .blog-article {
    text-align: right;
}

[dir="rtl"] .blog-article ul,
[dir="rtl"] .blog-article ol {
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .blog-hero-meta {
    text-align: right;
}

[dir="rtl"] .blog-modal #blogModalTitle {
    padding-left: 40px;
    padding-right: 0;
}

/* Urdu Specific Styling */
[lang="ur"] .blog-modal .modal-body {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
}

[lang="ur"] .blog-article p {
    text-align: right;
    line-height: 2;
}

[lang="ur"] .blog-article h2,
[lang="ur"] .blog-article h3,
[lang="ur"] .blog-article h4 {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', Arial, sans-serif;
    font-weight: 600;
}

/* Responsive Blog Modal */
@media (max-width: 768px) {
    .blog-modal .modal-content {
        width: 98%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .blog-modal .modal-header {
        padding: 20px 20px 12px;
    }
    
    .blog-modal #blogModalTitle {
        font-size: 1.5rem;
    }
    
    .blog-modal .modal-body {
        padding: 0 20px 20px;
        max-height: calc(95vh - 80px);
        font-size: 0.95rem;
    }
    
    .blog-hero {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .blog-hero .hero-icon {
        align-self: center;
    }
    
    .blog-hero-meta {
        justify-content: center;
    }
    
    .blog-article p {
        text-align: left;
        line-height: 1.7;
    }
    
    [dir="rtl"] .blog-article p {
        text-align: right;
    }
}

@media (max-width: 480px) {
    .blog-modal .modal-body {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .blog-modal #blogModalTitle {
        font-size: 1.3rem;
    }
    
    .blog-hero-meta {
        gap: 8px 12px;
    }
    
    .blog-hero-meta .badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

.blog-article img,
.blog-article video {
    max-width: 100%;
    border-radius: var(--radius-md);
    display: block;
}

/* Auth Styles */
.auth-tabs {
    display: flex;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active-form {
    display: block;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-info h3 {
    margin-bottom: 4px;
    font-size: 1.5rem;
}

.user-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.dashboard-nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
}

.dashboard-tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.dashboard-tab-btn.active,
.dashboard-tab-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.logout-btn {
    margin-left: auto;
    color: #EF4444 !important;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: #EF4444 !important;
}

.dashboard-content {
    padding: 40px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Dashboard Tabs */
.dashboard-tab {
    display: none;
}

.dashboard-tab.active {
    display: block;
}

.appointment-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.appointment-item:hover {
    box-shadow: var(--shadow-md);
}

.appointment-details h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.appointment-details p {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.appointment-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-confirmed {
    background: #DCFCE7;
    color: #166534;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* Chat Interface */
.chat-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 16px;
    text-align: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message.bot .message-avatar {
    background: var(--bg-accent);
    color: var(--text-secondary);
}

.message-content {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    max-width: 70%;
    box-shadow: var(--shadow-sm);
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.chat-input {
    display: flex;
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 25px;
    margin-right: 12px;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--primary-color);
}

.chat-send-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--footer-text);
    margin-bottom: 20px;
    font-size: 1.125rem;
}

.footer-section p {
    color: var(--footer-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--footer-text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--footer-text);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--footer-text-secondary);
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--footer-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--footer-text);
}



/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .header-content {
        padding: 12px 0;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .search-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .features-grid,
    .specialties-grid,
    .doctors-grid,
    .services-grid,
    .blogs-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .doctors-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .appointment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card,
    .service-card {
        padding: 24px;
    }
    
    .specialty-card {
        padding: 20px;
    }
    
    .contact-form,
    .modal-body {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-search {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 8px 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--bg-primary);
        box-shadow: var(--shadow-sm);
    }
    
    .header-content {
        padding: 8px 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .theme-toggle i {
        font-size: 16px;
    }
    
    .language-toggle button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }
    
    .nav.mobile-open {
        top: 60px;
        padding: 16px 0;
    }
    
    .nav.mobile-open .nav-list a {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .main {
        margin-top: 60px;
    }
    
    .auth-main {
        padding: 80px 12px 20px;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-container {
        padding: 16px;
    }
    
    .search-inputs {
        gap: 8px;
    }
    
    .search-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .btn-search {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .auth-card, .register-card {
        padding: 20px 16px;
        margin: 10px;
    }
    
    .form-control {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .input-group .form-control {
        padding-left: 40px;
    }
    
    .input-group i {
        left: 12px;
        font-size: 14px;
    }
    
    .progress-steps {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .step {
        min-width: 60px;
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .step-number {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 98%;
        margin: 10px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    /* Form Optimizations for Mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-control, .form-select {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        min-height: 48px; /* Touch-friendly */
    }
    
    .input-group .form-control {
        padding-left: 44px;
    }
    
    .input-group i {
        left: 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .btn-block {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .checkbox-group {
        margin: 16px 0;
    }
    
    .checkbox-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }
    
    .checkbox-group label {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Time Slots for Mobile */
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 8px;
        font-size: 13px;
        min-height: 40px;
    }
    
    /* Day Availability for Mobile */
    .day-availability {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .day-item {
        padding: 12px;
        border-radius: 8px;
    }
    
    .time-inputs {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .time-inputs input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Search Form Mobile */
    .search-container {
        margin: 16px 0;
        border-radius: 12px;
    }
    
    .search-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .search-input {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 8px;
        min-height: 48px;
    }
    
    .btn-search {
        padding: 14px 24px;
        font-size: 16px;
        min-height: 48px;
        border-radius: 8px;
        width: 100%;
    }
    
    /* Modal Optimizations */
    .modal {
        padding: 8px;
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 20px 16px 16px;
        border-bottom: 1px solid var(--border-light);
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .close {
        font-size: 24px;
        padding: 4px;
        width: 32px;
        height: 32px;
    }
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .search-inputs {
        grid-template-columns: 1fr 1fr auto;
        gap: 16px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .blogs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    .auth-container {
        grid-template-columns: 1fr 1fr;
        max-width: 900px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* Large Desktop Responsive Design */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        padding: 0 32px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
    
    .doctors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .blogs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
}

/* Ultra-wide Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .doctors-grid,
    .services-grid,
    .blogs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Small Mobile (Portrait) */
@media (max-width: 375px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .auth-card, .register-card {
        padding: 16px 12px;
        margin: 8px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .progress-steps {
        gap: 6px;
    }
    
    .step {
        min-width: 50px;
        padding: 6px 2px;
        font-size: 10px;
    }
    
    .step-number {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .time-slots {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .search-inputs {
        padding: 12px;
        gap: 10px;
    }
}

/* Large Mobile (Landscape) */
@media (min-width: 577px) and (max-width: 667px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .search-inputs {
        grid-template-columns: 1fr 1fr auto;
        gap: 12px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Small Tablet (Portrait) */
@media (min-width: 668px) and (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    
    .search-inputs {
        grid-template-columns: 1fr 1fr auto;
        gap: 16px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .time-slots {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

/* Medium Desktop */
@media (min-width: 1025px) and (max-width: 1199px) {
    .container {
        max-width: 1024px;
        padding: 0 28px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
    }
    
    .specialties-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
    
    .doctors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
    }
    
    .blogs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
    }
    
    .auth-container {
        grid-template-columns: 1fr 1fr;
        max-width: 1000px;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-light);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.text-success { color: var(--secondary-color); }
.text-warning { color: var(--accent-color); }
.text-danger { color: #EF4444; }
.bg-success { background: var(--secondary-color); }
.bg-warning { background: var(--accent-color); }
.bg-danger { background: #EF4444; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none; }
.visible { display: block; }

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL (Right-to-Left) Support for Urdu */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-content {
    grid-template-columns: 1fr 1fr;
    text-align: right;
}

[dir="rtl"] .hero-stats {
    text-align: center;
}

[dir="rtl"] .search-inputs {
    grid-template-columns: auto 1fr 1fr;
}

[dir="rtl"] .input-group i {
    left: auto;
    right: 16px;
}

[dir="rtl"] .input-group .form-control {
    padding-left: 16px;
    padding-right: 48px;
}

[dir="rtl"] .doctor-mini {
    flex-direction: row-reverse;
}

[dir="rtl"] .appointment-card {
    text-align: right;
}

[dir="rtl"] .floating-card.card-1 {
    left: auto;
    right: 10%;
}

[dir="rtl"] .floating-card.card-2 {
    right: auto;
    left: 10%;
}

[dir="rtl"] .nav-link.active::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .rating {
    flex-direction: row-reverse;
}

/* Language Toggle Button */
.language-toggle {
    position: relative;
}

.language-toggle button {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.language-toggle button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.language-toggle button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Urdu Font Support */
[dir="rtl"] body {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', Arial, sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', Arial, sans-serif;
    font-weight: 600;
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    [dir="rtl"] .search-inputs {
        grid-template-columns: 1fr;
    }
    
    [dir="rtl"] .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Font Awesome Fallback Styles */
.input-group i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    font-style: normal;
    font-weight: 900;
    font-size: 16px;
    color: var(--text-light);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

/* Fallback content for common icons if Font Awesome fails to load */
.fa-user:before { content: "👤"; }
.fa-user-md:before { content: "👨‍⚕️"; }
.fa-user-plus:before { content: "👤+"; }
.fa-envelope:before { content: "✉"; }
.fa-lock:before { content: "🔒"; }
.fa-eye:before { content: "👁"; }
.fa-eye-slash:before { content: "🙈"; }
.fa-phone:before { content: "📞"; }
.fa-phone-alt:before { content: "📱"; }
.fa-calendar:before { content: "📅"; }
.fa-calendar-alt:before { content: "📅"; }
.fa-venus-mars:before { content: "⚥"; }
.fa-weight:before { content: "⚖"; }
.fa-ruler-vertical:before { content: "📏"; }
.fa-tint:before { content: "💧"; }
.fa-notes-medical:before { content: "📋"; }
.fa-flag:before { content: "🏳"; }
.fa-briefcase:before { content: "💼"; }
.fa-graduation-cap:before { content: "🎓"; }
.fa-stethoscope:before { content: "🩺"; }
.fa-university:before { content: "🏛"; }
.fa-id-card:before { content: "🆔"; }
.fa-calendar-check:before { content: "✅"; }
.fa-cloud-upload-alt:before { content: "☁⬆"; }
.fa-camera:before { content: "📷"; }
.fa-clipboard-list:before { content: "📋"; }
.fa-money-bill-wave:before { content: "💰"; }
.fa-arrow-left:before { content: "←"; }
.fa-arrow-right:before { content: "→"; }

/* Ensure icons are visible */
.input-group i,
.fas, .far, .fab {
    opacity: 1 !important;
    visibility: visible !important;
}

/* User Profile Dropdown Styles */
.user-profile-dropdown {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-profile-btn:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.user-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-details h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-details p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.profile-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

.profile-sidebar {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.profile-avatar-section {
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    margin: 0 auto 16px;
    position: relative;
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 14px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-type {
    color: var(--text-light);
    font-size: 1rem;
}

.profile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-nav-item {
    margin-bottom: 8px;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.profile-nav-link:hover,
.profile-nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.profile-main {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
}

.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.edit-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.edit-toggle:hover {
    background: var(--primary-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

/* Appointments Page Styles */
.appointments-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.appointment-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab.active,
.filter-tab:hover {
    background: var(--primary-color);
    color: white;
}

.appointments-list {
    display: grid;
    gap: 20px;
}

.appointment-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.appointment-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.appointment-card.upcoming {
    border-left: 4px solid var(--success-color);
}

.appointment-card.completed {
    border-left: 4px solid var(--primary-color);
}

.appointment-card.cancelled {
    border-left: 4px solid var(--danger-color);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.doctor-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doctor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.doctor-details h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.doctor-details p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.upcoming {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.completed {
    background: var(--primary-light);
    color: var(--primary-color);
}

.status-badge.cancelled {
    background: var(--danger-light);
    color: var(--danger-color);
}

.appointment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.detail-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.appointment-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Settings Page Styles */
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.settings-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.settings-nav {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-item i {
    width: 16px;
    text-align: center;
}

.settings-sections {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.setting-group {
    margin-bottom: 40px;
}

.setting-group h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item.danger {
    border-color: var(--danger-light);
}

.setting-info {
    flex: 1;
}

.setting-info label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.setting-control {
    flex-shrink: 0;
}

.setting-control select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-width: 120px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-light);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.warning-message {
    background: var(--danger-light);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.warning-message i {
    color: var(--danger-color);
    font-size: 1.2rem;
}

.warning-message p {
    margin: 0;
    color: var(--danger-color);
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design for Profile Pages */
@media (max-width: 768px) {
    .profile-content,
    .settings-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-sidebar,
    .settings-nav {
        position: static;
    }
    
    .appointment-filters {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .appointment-details {
        grid-template-columns: 1fr;
    }
    
    .appointment-actions {
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .setting-control {
        align-self: flex-start;
    }
}

/* AI Chat Styles */
.ai-chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-primary);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 10px 16px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.ai-chat-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.ai-chat-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.ai-chat-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-icon-circle i {
    font-size: 20px;
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

.ai-chat-board {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

.ai-chat-board.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-title i {
    font-size: 18px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-secondary, #f8f9fa);
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

.bot-message .message-content {
    background: var(--bg-primary, #ffffff) !important;
    color: var(--text-primary, #0f172a) !important;
    border: 1px solid var(--border-color, #cbd5e1);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

/* Ensure inner text inherits correct color and full opacity */
.ai-chat-board .bot-message .message-content p,
.ai-chat-board .bot-message .message-content span,
.ai-chat-board .bot-message .message-content div {
    color: inherit !important;
    opacity: 1 !important;
}

.user-message .message-content {
    background: var(--primary-color);
    color: #ffffff !important;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chat-board .user-message .message-content p,
.ai-chat-board .user-message .message-content span,
.ai-chat-board .user-message .message-content div {
    color: inherit !important;
    opacity: 1 !important;
}

.ai-chat-board .btn {
    font-weight: 600;
}

.ai-chat-board .btn.btn-primary {
    background: #0ea5e9; /* sky-500 */
    color: #ffffff;
    border: 1px solid #0284c7; /* sky-600 */
}

.ai-chat-board .btn.btn-primary:hover {
    background: #0284c7;
}

.ai-chat-board .btn.btn-ghost {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #94a3b8; /* slate-400 */
}

.ai-chat-board .btn.btn-ghost:hover {
    background: #f1f5f9;
}

/* Chat suggestion chips */
.ai-chat-board .chat-suggestions .message-content {
    padding-top: 8px;
}
.ai-chat-board .chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 6px 0 2px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;      /* Firefox */
}
.ai-chat-board .chips::-webkit-scrollbar { display: none; }
.chat-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color, #cbd5e1);
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.chat-chip:hover { background: #f8fafc; border-color: #94a3b8; }
.chat-suggestions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary, #334155);
}
.chips-toggle {
    background: none;
    border: none;
    color: var(--primary-color, #0ea5e9);
    cursor: pointer;
    font-weight: 600;
}

/* Dark theme overrides for AI Chat */
[data-theme="dark"] .ai-chat-board {
    background: #0b1220;
    border-color: #1f2937;
}
[data-theme="dark"] .chat-messages {
    background: #0b1220;
}
[data-theme="dark"] .bot-message .message-content {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #374151;
}
[data-theme="dark"] .user-message .message-content {
    background: #0ea5e9;
    color: #ffffff !important;
}
[data-theme="dark"] .chat-input-container {
    background: #0b1220;
    border-top-color: #1f2937;
}
[data-theme="dark"] .chat-input {
    background: #0f172a;
    color: #e5e7eb !important;
    border-color: #1f2937;
}
[data-theme="dark"] .chat-input::placeholder {
    color: #94a3b8 !important;
}
[data-theme="dark"] .ai-chat-board .btn.btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border-color: #475569;
}
[data-theme="dark"] .ai-chat-board .btn.btn-ghost:hover {
    background: #1f2937;
}

.chat-input-container {
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #030810);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #1a202c) !important;
    font-weight: 500;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.chat-input::placeholder {
    color: var(--text-secondary, #0b0e13) !important;
    opacity: 1;
}

.chat-send {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.chat-send:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive AI Chat */
@media (max-width: 768px) {
    .ai-chat-icon {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .ai-chat-icon i {
        font-size: 20px;
    }
    
    .ai-chat-board {
        bottom: 80px;
        right: 20px;
        left: 20px;
        width: auto;
        height: 400px;
    }
    
    .message-content {
        max-width: 90%;
    }
}

/* Typing Indicator Animation */
.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-light);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ================= Profile Page (profile.html) ================ */
/* Hero */
.profile-hero {
    background: var(--gradient-primary, linear-gradient(135deg, #0EA5E9 0%, #06B6D4 100%));
    padding: 80px 0;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.profile-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: .3;
}
.profile-avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-xl);
    border: 3px solid rgba(255,255,255,.2);
    position: relative;
    z-index: 1;
}
.profile-name { color: #ffffff; text-shadow: 0 2px 6px rgba(0,0,0,.2); }
.profile-type { font-size: 1.1rem; color: rgba(255,255,255,0.85); margin-bottom: 24px; }
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; display: block; color: #ffffff; }
.stat-label { font-size: .9rem; color: rgba(255,255,255,0.85); }

/* Arrange stats in a single row with wrap on small screens */
.profile-stats { display: flex; align-items: center; justify-content: center; gap: 48px; flex-wrap: wrap; margin-top: 24px; }

@media (max-width: 640px) {
  .profile-stats { gap: 24px; }
  .stat-number { font-size: 1.6rem; }
}

/* Content container override (conflicts with earlier grid) */
.profile-content {
    max-width: 1100px;
    margin: -40px auto 0;
    padding: 0 24px 72px;
    position: relative;
    z-index: 2;
    display: block !important;
    grid-template-columns: unset !important;
    gap: 0 !important;
}

.profile-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color, #e2e8f0);
}

.info-section { margin-bottom: 40px; }
.section-title { font-size: 1.5rem; font-weight: 600; color: #1e293b; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.section-title i { color: #2563eb; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.info-item { background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
.info-label { font-size: .9rem; color: #64748b; margin-bottom: 8px; font-weight: 500; }
.info-value { font-size: 1.1rem; color: #1e293b; font-weight: 600; }

.edit-profile-btn { position: fixed; bottom: 30px; right: 30px; width: 64px; height: 64px; border-radius: 50%; background: var(--gradient-primary, linear-gradient(135deg,#0EA5E9,#06B6D4)); color: #fff; border: none; box-shadow: var(--shadow-xl); cursor: pointer; transition: var(--transition); z-index: 1000; display:flex; align-items:center; justify-content:center; font-size:1.5rem; }
.edit-profile-btn:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 20px 40px rgba(14,165,233,.4); }

.modal-body { padding: 0 40px 40px; max-height: calc(95vh - 200px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
/* hide inner scrollbar but keep scrolling */
.modal-body::-webkit-scrollbar { width: 0; height: 0; }
.modal-body { scrollbar-width: none; -ms-overflow-style: none; }
.modal-actions { display: flex; gap: 20px; justify-content: flex-end; margin-top: 40px; padding: 30px 40px 0; border-top: 1px solid var(--border-color, #e2e8f0); }

/* Form controls */
.form-section { margin-bottom: 32px; }
.form-section-title { font-size: 18px; font-weight: 600; color: var(--text-primary, #0F172A); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.form-section-title::before { content: ''; width: 4px; height: 20px; background: var(--gradient-primary, linear-gradient(135deg, #0EA5E9, #06B6D4)); border-radius: 2px; }
.form-group { margin-bottom: 24px; position: relative; }
.form-label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text-primary, #0F172A); font-size: 14px; letter-spacing: 0.5px; text-transform: uppercase; }
.form-input { display: block; width: 100%; padding: 12px 14px; border: 2px solid var(--border-color, #E2E8F0); border-radius: 10px; background: var(--bg-primary, #fff); color: var(--text-primary, #0F172A); font-size: 14px; transition: var(--transition, all .3s ease); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
input.form-input, select.form-input, textarea.form-input { appearance: none; -webkit-appearance: none; }
.form-input::placeholder { color: var(--text-light, #64748B); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.upload-btn { background: var(--primary-color, #0EA5E9); color: #fff; border: none; padding: 12px 24px; border-radius: 8px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.upload-btn:hover { background: var(--primary-dark, #0284C7); }
.profile-picture-section { text-align: center; margin-bottom: 40px; padding: 30px; background: var(--bg-secondary, #F8FAFC); border-radius: 16px; border: 2px dashed var(--border-color, #E2E8F0); }
.profile-picture-preview { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px; background: var(--gradient-primary, linear-gradient(135deg, #0EA5E9, #06B6D4)); display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; color: #fff; position: relative; overflow: hidden; box-shadow: 0 8px 32px rgba(14,165,233,0.3); }
.file-input { display: none; }

/* Dark theme adjustments for modal/form */
[data-theme="dark"] .modal-content { background: #0b1220; border-color: #1f2937; }
[data-theme="dark"] .modal-title { color: #e5e7eb; }
[data-theme="dark"] .form-label { color: #e5e7eb; }
[data-theme="dark"] .form-input { background: #0f172a; color: #e5e7eb; border-color: #1f2937; box-shadow: none; }
[data-theme="dark"] .form-input::placeholder { color: #94a3b8; }
[data-theme="dark"] .modal-actions { border-top-color: #1f2937; }

@media (max-width: 768px) {
    .profile-card { padding: 20px; }
    .info-grid { grid-template-columns: 1fr; }
}