/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --font-primary: 'Inter', sans-serif;
    --font-arabic: 'Noto Sans Arabic', sans-serif;
}

[dir="rtl"] {
    font-family: var(--font-arabic);
}

[dir="rtl"] body {
    text-align: right;
}

/* Dark Theme */
.dark-theme {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --border-color: #334155;
    --border-light: #475569;
}

/* Base Styles */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.3s ease;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: all 0.3s ease;
}

.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-color);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-btn,
.theme-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-btn:hover,
.theme-btn:hover {
    background: var(--bg-tertiary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.dark-theme .hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

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

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.dark-theme .floating-card {
    background: var(--bg-secondary);
}

.floating-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.floating-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.floating-card p {
    color: var(--text-secondary);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Departments Section */
.departments {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.search-container {
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.department-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.department-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.department-name-ar {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: var(--font-arabic);
}

.department-category {
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.department-details {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
}

.department-shifts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shift-badge {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.chatbot-modal,
.voice-modal {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Chat Interface */
.chat-container,
.voice-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    max-height: 70vh; /* Better mobile experience */
}

.chat-messages,
.voice-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: var(--primary-color);
    color: white;
}

.user-message .message-avatar {
    background: var(--accent-color);
    color: white;
}

.message-content {
    flex: 1;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    position: relative;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.message-text {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-text p {
    margin: 0 0 0.5rem 0;
}

.message-text ul,
.message-text ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-text li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.message-text strong {
    font-weight: 600;
    color: inherit;
}

.message-text em {
    font-style: italic;
}

.department-info {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 1px 0;
}

.arabic-text {
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

/* RTL Support for Arabic messages */
.message[dir="rtl"] {
    direction: rtl;
    text-align: right;
    justify-content: flex-end;
    flex-direction: row;
}

.message[dir="rtl"] .message-avatar {
    order: 2;
    margin-left: 0.75rem;
    margin-right: 0;
}

.message[dir="rtl"] .message-content {
    order: 1;
    text-align: right;
}

/* LTR Support for English messages */
.message[dir="ltr"] {
    direction: ltr;
    text-align: left;
    justify-content: flex-start;
    flex-direction: row;
}

.message[dir="ltr"] .message-avatar {
    order: 1;
    margin-right: 0.75rem;
    margin-left: 0;
}

.message[dir="ltr"] .message-content {
    order: 2;
    text-align: left;
}

/* Default message styling (fallback) */
.message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    direction: ltr;
    text-align: left;
    justify-content: flex-start;
    flex-direction: row;
}

/* Message direction will be handled dynamically by JavaScript */

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
    display: block;
    margin-top: 0.5rem;
}

.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

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

.chat-input button {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    background: var(--primary-dark);
}

/* Voice Interface */
.voice-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    max-height: 70vh;
    padding: 2rem;
}

.voice-animation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 2rem;
}

.voice-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.voice-avatar.listening {
    animation: pulse-avatar 1.5s infinite;
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.voice-avatar.speaking {
    animation: speak-avatar 0.8s infinite alternate;
    background: linear-gradient(135deg, var(--accent-color), #d97706);
}

.voice-avatar.processing {
    animation: process-avatar 1s infinite;
    background: linear-gradient(135deg, var(--secondary-color), #475569);
}

.voice-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-waves.active {
    opacity: 1;
}

.wave {
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: wave-animation 1.2s infinite ease-in-out;
}

.wave:nth-child(1) { animation-delay: -0.4s; }
.wave:nth-child(2) { animation-delay: -0.3s; }
.wave:nth-child(3) { animation-delay: -0.2s; }
.wave:nth-child(4) { animation-delay: -0.1s; }
.wave:nth-child(5) { animation-delay: 0s; }

@keyframes pulse-avatar {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes speak-avatar {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

@keyframes process-avatar {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(180deg); }
}

@keyframes wave-animation {
    0%, 40%, 100% { transform: scaleY(0.4); }
    20% { transform: scaleY(1); }
}

/* New Voice Button Animations */
@keyframes listening-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 12px 40px rgba(16, 185, 129, 0.5);
    }
}

@keyframes microphone-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

@keyframes speaking-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5);
    }
}

@keyframes interrupt-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
        border-color: #fbbf24;
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 0 35px rgba(245, 158, 11, 0.9);
        border-color: #f59e0b;
    }
}

@keyframes volume-wave {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.voice-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem 1rem;
}

/* Main Voice Assistant Button */
.voice-main-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.voice-main-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-main-btn:hover::before {
    opacity: 1;
}

.voice-main-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.4);
}

.voice-main-btn:active {
    transform: scale(0.98);
}

.voice-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.voice-main-btn i {
    font-size: 3rem;
    transition: all 0.3s ease;
}

.voice-btn-text {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Voice Button States */
.voice-main-btn.ready {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    animation: none;
}

.voice-main-btn.connecting {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    animation: pulse 1.5s infinite;
}

.voice-main-btn.connecting i {
    animation: spin 1s linear infinite;
}

.voice-main-btn.active {
    background: linear-gradient(135deg, var(--success-color), #059669);
    animation: pulse 1s infinite;
}

.voice-main-btn.active i {
    transform: scale(1.1);
}

.voice-main-btn.listening {
    background: linear-gradient(135deg, var(--success-color), #059669);
    animation: listening-pulse 1.5s infinite;
}

.voice-main-btn.listening i {
    animation: microphone-bounce 0.8s infinite alternate;
}

.voice-main-btn.speaking {
    background: linear-gradient(135deg, var(--accent-color), #d97706);
    animation: interrupt-pulse 0.8s infinite alternate;
    cursor: pointer;
    border: 3px solid #fbbf24;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.voice-main-btn.speaking:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
    border-color: #f59e0b;
}

.voice-main-btn.speaking i {
    animation: volume-wave 0.6s infinite alternate;
}

/* Voice Features */
.voice-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Transcript Display */
.transcript-display {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.transcript-display h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #495057;
}

.transcript-content {
    min-height: 60px;
}

.partial-transcript {
    color: #6c757d;
    font-style: italic;
    margin: 5px 0;
    font-size: 14px;
}

.final-transcript {
    color: #212529;
    font-weight: 500;
    margin: 5px 0;
    font-size: 14px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 8px 12px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.status-indicator {
    font-size: 12px;
    margin-right: 8px;
}

/* Voice Chat History */
.voice-chat-history {
    font-family: inherit;
}

.voice-message {
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in;
}

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

@keyframes speaking {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.voice-instructions {
    margin-top: 1rem;
    text-align: center;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.instruction-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Typing Indicator Animation */
.typing-indicator {
    opacity: 0.7;
}

.typing-animation {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 8px 12px;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-animation span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-animation span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.voice-status {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Quick Info Cards */
.quick-info {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section p,
.footer-section li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .departments-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .chat-container,
    .voice-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }
    
    .hero {
        padding: 6rem 0 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile Chat Improvements */
@media (max-width: 768px) {
    .chat-container,
    .voice-container {
        height: 60vh;
        max-height: 60vh;
    }
    
    .chat-messages,
    .voice-messages {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    .message-content {
        padding: 0.75rem;
    }
    
    .message-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .chat-input input {
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
    }
    
    .chat-input button {
        padding: 0.6rem 0.8rem;
    }
    
    /* Improve Arabic text on mobile */
    .arabic-text {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    /* Voice Assistant Mobile Styles */
    .voice-main-btn {
        width: 160px;
        height: 160px;
    }
    
    .voice-main-btn i {
        font-size: 2.5rem;
    }
    
    .voice-btn-text {
        font-size: 0.9rem;
    }
    
    .voice-features {
        gap: 1rem;
    }
    
    .feature-item {
        font-size: 0.8rem;
    }
    
    .voice-controls {
        padding: 1rem 0.5rem;
        gap: 1.5rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: 80vh;
    }
    
    .chat-container,
    .voice-container {
        height: 50vh;
        max-height: 50vh;
    }
    
    .message {
        gap: 0.5rem;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .message-content {
        padding: 0.6rem;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    /* Voice Assistant Small Screen Styles */
    .voice-main-btn {
        width: 140px;
        height: 140px;
    }
    
    .voice-main-btn i {
        font-size: 2rem;
    }
    
    .voice-btn-text {
        font-size: 0.8rem;
    }
    
    .voice-features {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feature-item {
        font-size: 0.75rem;
    }
    
    .voice-controls {
        padding: 0.5rem;
        gap: 1rem;
    }
    
    .voice-instructions {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
}


/* FORCE LTR MESSAGE ALIGNMENT - OVERRIDE ALL RTL STYLES */
.force-ltr-message,
.force-ltr-message *,
.force-ltr-message .message-content,
.force-ltr-message .message-text {
    direction: ltr !important;
    text-align: left !important;
    justify-content: flex-start !important;
    unicode-bidi: normal !important;
}

.force-ltr-message .message-avatar {
    order: 0 !important;
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

.force-ltr-message .message-content {
    order: 1 !important;
}
