@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties for Avatar Theming */
:root {
    --avatar-size: 48px;
    --avatar-border-radius: 16px;
    --avatar-border-color: rgba(48, 213, 200, 0.2);
    --avatar-border-hover: #30d5c8;
    --avatar-shadow: rgba(48, 213, 200, 0.3);
    --avatar-bg: rgba(255, 255, 255, 0.1);
    --avatar-transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Persian/RTL Support */
.persian-text {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    direction: rtl;
    text-align: right;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Enhanced Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #30d5c8 0%, #2bb8ad 25%, #1a9d92 50%, #0d8074 75%, #0d8074 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Background Animation Styles */
@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-1000 {
    animation-delay: 1s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-3000 {
    animation-delay: 3s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animation-delay-5000 {
    animation-delay: 5s;
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}



/* Pulse Animation */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

.pulse-ring {
    animation: pulse-ring 2s ease-in-out infinite;
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(48, 213, 200, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2bb8ad, #1a9d92);
}

/* Message Bubbles */
.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 8px;
    word-wrap: break-word;
    animation: fadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: bottom left;
}

.message-bubble.user {
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    transform-origin: bottom right;
}

.message-bubble.ai {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #1e293b;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid #bae6fd;
}

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

/* Input Area Glam Up */
.input-area-container {
    position: relative;
    transition: all 0.3s ease;
}

.input-area-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit; /* Match the container's border-radius */
    padding: 2px; /* Border thickness */
    background: linear-gradient(120deg, #30d5c8, #2bb8ad, transparent, transparent);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.input-area-container:focus-within::before {
    opacity: 1;
}

#messageInput {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#messageInput:focus {
    box-shadow: 0 0 15px rgba(48, 213, 200, 0.3);
    transform: scale(1.01);
}

/* Voice Recording Active State */
.voice-recording-active {
    background: linear-gradient(135deg, #ef4444, #f87171) !important;
    animation: pulse-recording 1.5s infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
    }
}

/* Teacher Card Styles */
.teacher-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
}

.teacher-card:hover {
    background: rgba(48, 213, 200, 0.1);
    transform: scale(1.05);
    border-color: rgba(48, 213, 200, 0.3);
}

.teacher-card.active {
    background: rgba(48, 213, 200, 0.2);
    border-color: #30d5c8;
    box-shadow: 0 4px 20px rgba(48, 213, 200, 0.3);
}

.teacher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Topic Cards */
.topic-card {
    position: relative;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.topic-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.topic-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.topic-card:hover::before {
    transform: translateX(100%);
}

/* Role Selection Panel Styles */
.role-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.role-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.role-btn .role-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.role-btn .role-info {
    flex: 1;
    text-align: right;
}

.role-btn .role-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.role-btn .role-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Session Card */
.session-card {
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    margin-bottom: 8px;
}

.session-card:hover {
    background: rgba(48, 213, 200, 0.1);
    border-color: rgba(48, 213, 200, 0.3);
}

.session-card.active {
    background: rgba(48, 213, 200, 0.2);
    border-color: #30d5c8;
}

/* Input Focus Styles */
input[type="text"]:focus,
input[type="range"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(48, 213, 200, 0.2);
}

/* Range Input Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    /* NEW: Use a CSS variable for the background gradient */
    /* UPDATED: Changed gradient direction to 'to left' for RTL support */
    background: linear-gradient(to left, #30d5c8 var(--track-progress, 50%), #e5e7eb var(--track-progress, 50%));
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(48, 213, 200, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(48, 213, 200, 0.4);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
}

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

button:active {
    transform: translateY(0);
}

/* Conversation Line Styles */
.conversation-line {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    animation: slideIn 0.4s ease-out;
}

.conversation-line.teacher {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left: 4px solid #3b82f6;
}

.conversation-line.student {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 90%;
    }
    
    .teacher-card {
        padding: 8px;
    }
    
    .teacher-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}





/* Modern Navbar Header Styles */
.modern-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(48, 213, 200, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    transform: translateY(0);
}

/* Dynamic Header Scroll Behavior - Mirrored/Sticky Style */
.modern-navbar.sticky-active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(30px);
    border-bottom: 3px solid linear-gradient(90deg, #30d5c8, #2bb8ad, #1a9d92);
    box-shadow: 0 8px 32px rgba(48, 213, 200, 0.2), 0 0 0 1px rgba(48, 213, 200, 0.1);
    transform: translateY(0) scale(1.02);
}
.modern-navbar.sticky-active .modern-navbar-brand {
    background: linear-gradient(135deg, #30d5c8, #2bb8ad, #1a9d92);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(48, 213, 200, 0.3);
}
.modern-navbar.sticky-active .modern-navbar-nav-link {
    background: rgba(48, 213, 200, 0.08);
    border-color: rgba(48, 213, 200, 0.2);
}

.modern-navbar.hidden {
    transform: translateY(-100%) scale(1);
    opacity: 0;
}

/* Enhanced Glass Effect for Sticky State */
.modern-navbar.sticky-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        rgba(48, 213, 200, 0.03) 0%,
        rgba(56, 189, 248, 0.03) 25%,
        rgba(48, 213, 200, 0.03) 50%,
        rgba(56, 189, 248, 0.03) 75%,
        rgba(48, 213, 200, 0.03) 100%);
    pointer-events: none;
    border-radius: 0 0 16px 16px;
    z-index: -1;
}

.modern-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.modern-navbar-logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modern-navbar-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(48, 213, 200, 0.3);
    transition: all 0.3s ease;
}

.modern-navbar-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(48, 213, 200, 0.4);
}

.modern-navbar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
}

.modern-navbar-brand {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    persian-text: true;
    margin: 0;
}

.modern-navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modern-navbar-nav-link {
    padding: 12px 20px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    persian-text: true;
    transition: all 0.3s ease;
    background: transparent;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.modern-navbar-nav-link:hover {
    color: #30d5c8;
    background: rgba(48, 213, 200, 0.1);
    border-color: rgba(48, 213, 200, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(48, 213, 200, 0.2);
}

.modern-navbar-nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.1), rgba(48, 213, 200, 0.05));
    border-radius: inherit;
    transition: all 0.4s ease;
    z-index: -1;
}

.modern-navbar-nav-link:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.modern-navbar-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 32px;
    flex: 1;
    max-width: 300px;
}

.modern-navbar-search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 16px;
    border: 2px solid rgba(48, 213, 200, 0.2);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: #374151;
    font-size: 14px;
    persian-text: true;
    transition: all 0.3s ease;
    outline: none;
}

.modern-navbar-search-input:focus {
    border-color: #30d5c8;
    box-shadow: 0 0 0 3px rgba(48, 213, 200, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.modern-navbar-search-btn {
    padding: 14px 16px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(48, 213, 200, 0.3);
}

.modern-navbar-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(48, 213, 200, 0.4);
}

.modern-navbar-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modern-navbar-user-auth {
    display: flex;
    gap: 12px;
}

.modern-navbar-auth-btn {
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.modern-navbar-login-btn {
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    color: white;
    box-shadow: 0 4px 12px rgba(48, 213, 200, 0.3);
}

.modern-navbar-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(48, 213, 200, 0.4);
    text-decoration: none;
    color: white;
}

.modern-navbar-signup-btn {
    background: transparent;
    color: #30d5c8;
    border-color: rgba(48, 213, 200, 0.3);
}

.modern-navbar-signup-btn:hover {
    background: rgba(48, 213, 200, 0.1);
    border-color: #30d5c8;
    transform: translateY(-2px);
    text-decoration: none;
    color: #30d5c8;
}

.modern-navbar-user-dropdown {
    position: relative;
}

.modern-navbar-user-avatar {
    /* Layout and Dimensions */
    width: var(--avatar-size, 48px);
    height: var(--avatar-size, 48px);
    aspect-ratio: 1;
    border-radius: var(--avatar-border-radius, 16px);

    /* Interactive Properties */
    cursor: pointer;
    overflow: hidden;

    /* Visual Styling */
    border: 2px solid var(--avatar-border-color, rgba(48, 213, 200, 0.2));
    background: var(--avatar-bg, rgba(255, 255, 255, 0.1));

    /* Performance-Optimized Transitions */
    transition: var(--avatar-transition, border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                                      transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                                      box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1));

    /* Performance Optimization */
    will-change: transform, border-color, box-shadow;

    /* Accessibility */
    outline: none;
    position: relative;
}

.modern-navbar-user-avatar:focus-visible {
    border-color: var(--avatar-border-hover, #30d5c8);
    box-shadow: 0 0 0 3px rgba(48, 213, 200, 0.3);
}

/* Enhanced Hover Effects */
.modern-navbar-user-avatar:hover {
    border-color: var(--avatar-border-hover, #30d5c8);
    transform: scale(1.08) translateZ(0);
    box-shadow: 0 6px 20px var(--avatar-shadow, rgba(48, 213, 200, 0.3)),
                0 0 0 4px rgba(48, 213, 200, 0.1);
}

/* Image Loading States */
.modern-navbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.modern-navbar-user-avatar img:not([src]) {
    opacity: 0;
}

.modern-navbar-user-avatar img[src] {
    opacity: 1;
}

/* Loading Placeholder */
.modern-navbar-user-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.1), rgba(48, 213, 200, 0.05));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-navbar-user-avatar img:not([src])::before {
    opacity: 1;
}

/* Error State */
.modern-navbar-user-avatar img[src=""],
.modern-navbar-user-avatar img[src="#"] {
    display: none;
}

.modern-navbar-user-avatar img[src=""],
.modern-navbar-user-avatar img[src="#"]::after {
    content: '👤';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(48, 213, 200, 0.6);
}

.modern-navbar-user-avatar:hover {
    border-color: #30d5c8;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(48, 213, 200, 0.3);
}

.modern-navbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-navbar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(48, 213, 200, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modern-navbar-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modern-navbar-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.1), rgba(48, 213, 200, 0.05));
    border-bottom: 1px solid rgba(48, 213, 200, 0.2);
}

.modern-navbar-dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-navbar-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(48, 213, 200, 0.3);
}

.modern-navbar-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-navbar-dropdown-user-details {
    flex: 1;
}

.modern-navbar-dropdown-user-name {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    font-size: 14px;
}

.modern-navbar-dropdown-user-email {
    color: #6b7280;
    font-size: 12px;
    margin: 4px 0 0 0;
}

.modern-navbar-dropdown-item {
    display: block;
    padding: 14px 20px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: right;
    persian-text: true;
    font-size: 14px;
}

.modern-navbar-dropdown-item:hover {
    background: rgba(48, 213, 200, 0.1);
    color: #30d5c8;
    transform: translateX(-4px);
}

.modern-navbar-dropdown-item i {
    margin-left: 12px;
}

.modern-navbar-dropdown-divider {
    height: 1px;
    background: rgba(48, 213, 200, 0.2);
    margin: 8px 0;
}

.modern-navbar-logout {
    color: #ef4444 !important;
}

.modern-navbar-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

/* Mobile Menu Toggle Button */
.modern-navbar-mobile-toggle {
    display: none;
    align-items: center;
    margin-left: 16px;
}

.modern-navbar-mobile-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    color: var(--bs-gray-700);
    color: rgb(0, 0, 0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(48, 213, 200, 0.3);
}

.modern-navbar-mobile-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(48, 213, 200, 0.4);
}

.modern-navbar-mobile-btn i {
    transition: transform 0.3s ease;
}

.modern-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 1040;
    transition: all 0.3s ease;
}

.modern-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modern-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(30px);
    border-left: 2px solid rgba(48, 213, 200, 0.2);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modern-sidebar.active {
    right: 0;
}

.modern-sidebar::-webkit-scrollbar {
    width: 4px;
}

.modern-sidebar::-webkit-scrollbar-track {
    background: rgba(48, 213, 200, 0.1);
}

.modern-sidebar::-webkit-scrollbar-thumb {
    background: rgba(48, 213, 200, 0.3);
    border-radius: 2px;
}

.modern-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(48, 213, 200, 0.5);
}

.modern-sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.1), rgba(48, 213, 200, 0.05));
    border-bottom: 1px solid rgba(48, 213, 200, 0.2);
    position: relative;
}

.modern-sidebar-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(48, 213, 200, 0.2);
    color: #30d5c8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modern-sidebar-close:hover {
    background: rgba(48, 213, 200, 0.3);
    transform: scale(1.1);
    color: #2bb8ad;
}

.modern-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.modern-sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(48, 213, 200, 0.3);
}

.modern-sidebar-logo h2 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    persian-text: true;
    margin: 0;
}

.modern-sidebar-content {
    padding: 0;
}

.modern-sidebar-section {
    padding: 20px;
    border-bottom: 1px solid rgba(48, 213, 200, 0.1);
}

.modern-sidebar-section:last-child {
    border-bottom: none;
}

.modern-sidebar-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    persian-text: true;
    margin-bottom: 16px;
    position: relative;
    padding-right: 12px;
}

.modern-sidebar-section-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    border-radius: 2px;
}

.modern-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modern-sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #4b5563;
    persian-text: true;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.modern-sidebar-nav-link:hover {
    background: rgba(48, 213, 200, 0.1);
    color: #30d5c8;
    transform: translateX(-4px);
    border-color: rgba(48, 213, 200, 0.3);
}

.modern-sidebar-nav-link i {
    width: 20px;
    text-align: center;
    color: #6b7280;
    transition: color 0.3s ease;
}

.modern-sidebar-nav-link:hover i {
    color: #30d5c8;
}

.modern-sidebar-nav-link span {
    flex: 1;
}

.modern-sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(48, 213, 200, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(48, 213, 200, 0.2);
    margin-bottom: 16px;
}

.modern-sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(48, 213, 200, 0.3);
}

.modern-sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-sidebar-user-details {
    flex: 1;
}

.modern-sidebar-user-details p {
    margin: 0;
    font-size: 13px;
}

.modern-sidebar-user-name {
    font-weight: 600;
    color: #1f2937 !important;
}

.modern-sidebar-user-email {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px !important;
}

.modern-sidebar-auth-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    persian-text: true;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    color: white;
    border: 2px solid transparent;
    justify-content: center;
}

.modern-sidebar-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(48, 213, 200, 0.3);
    text-decoration: none;
    color: white;
}

.modern-sidebar-auth-btn i {
    width: 20px;
    text-align: center;
}

.modern-sidebar-logout {
    color: #ef4444 !important;
    border: 2px solid rgba(239, 68, 68, 0.2) !important;
}

.modern-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    transform: translateX(-4px);
}

.modern-sidebar-logout i {
    color: #ef4444 !important;
}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .modern-navbar-search {
        display: none;
    }

    .modern-navbar-nav {
        display: none;
    }

    .modern-navbar-user-auth .modern-navbar-login-btn {
        display: none;
    }

    .modern-navbar-user-auth .modern-navbar-signup-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .modern-navbar-mobile-toggle {
        display: flex !important;
    }

    .modern-navbar {
        padding: 8px 16px;
    }

    .modern-navbar-logo-section {
        gap: 12px;
    }

    .modern-navbar-logo {
        width: 48px;
        height: 48px;
    }

    .modern-navbar-logo img {
        width: 32px;
        height: 32px;
    }

    .modern-navbar-brand {
        font-size: 20px;
    }

    /* Mobile Dropdown Positioning Fix */
    .modern-navbar-dropdown {
        min-width: 200px;
        max-width: calc(100vw - 32px); /* Ensure it doesn't exceed viewport width */
        right: auto; /* Reset right positioning */
        left: 50%; /* Center horizontally */
        transform: translateX(-50%) translateY(-10px); /* Center and maintain animation */
        margin-top: 8px;
    }

    .modern-navbar-dropdown.show {
        transform: translateX(-50%) translateY(0); /* Center when shown */
    }

    .modern-navbar-dropdown-header {
        padding: 16px;
    }

    .modern-navbar-dropdown-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Ensure dropdown doesn't overflow on very small screens */
    @media (max-width: 480px) {
        .modern-navbar-dropdown {
            min-width: 180px;
            max-width: calc(100vw - 16px);
            left: 50%;
            transform: translateX(-50%) translateY(-10px);
        }

        .modern-navbar-dropdown.show {
            transform: translateX(-50%) translateY(0);
        }
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .modern-navbar-nav {
        gap: 4px;
    }

    .modern-navbar-nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .modern-navbar-search {
        margin: 0 20px;
        max-width: 250px;
    }
}



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

@media (min-width: 768px) {
    .header-container {
        padding: 1rem 1.5rem;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .header-logo-section {
        gap: 0.75rem;
    }
}

.header-logo-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

@media (min-width: 768px) {
    .header-logo-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.header-logo-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

@media (min-width: 768px) {
    .header-logo-icon svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

.header-title {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
    margin: 0;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (min-width: 768px) {
    .header-title {
        font-size: 1.5rem;
    }
}

.header-nav {
    display: none;
}

@media (min-width: 768px) {
    .header-nav {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
}

.header-nav-btn {
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.header-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-user-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-user-btn {
    padding: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.header-user-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile-specific header styles */
@media (max-width: 767px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .header-logo-icon {
        width: 2rem;
        height: 2rem;
    }

    .header-logo-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .header-title {
        font-size: 1.2rem;
    }
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.95), rgba(56, 189, 248, 0.95));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(48, 213, 200, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    font-size: 14px;
    persian-text: true;
    direction: rtl;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0;
    min-height: 72px;
}

/* Progress bar at bottom of toast (countdown) */
.toast {
    position: relative;
    overflow: hidden;
}

.toast-progress {
    position: absolute;
    left: 0;
    right: auto;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    width: 100%;
    transform-origin: right center;
}

.toast.show .toast-progress {
    /* when shown, JS will trigger the shrink via width transition */
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.hiding {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    width: 100%;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toast-message {
    flex: 1;
    line-height: 1.5;
    text-align: right;
    font-weight: 500;
}

.toast-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

/* Toast Variants */
.toast-info .toast-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
    color: #dbeafe;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.8));
    color: #dcfce7;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}
.toast-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.8), rgba(217, 119, 6, 0.8));
    color: #fef3c7;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
    color: #fee2e2;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}
.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Voice Mode Styles */
.voice-mode-active {
    background: linear-gradient(135deg, rgba(48, 213, 200, 0.05), rgba(56, 189, 248, 0.05));
    transition: background 0.3s ease;
}

.voice-mode-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(48, 213, 200, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.voice-mode-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Voice Pulse Animation */
@keyframes voicePulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.voice-pulse {
    animation: voicePulse 2s ease-in-out infinite;
}

/* Recording Indicator */
.recording-indicator {
    position: relative;
}

.recording-indicator::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, #ef4444, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Voice Button Hover Effects */
#startVoiceBtn:hover {
    box-shadow: 0 8px 25px rgba(48, 213, 200, 0.4);
}

#startVoiceBtn:active {
    transform: scale(0.98);
}

/* Voice Settings Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    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: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #30d5c8, #2bb8ad);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Voice Mode Button States */
.voice-mode-btn {
    transition: all 0.3s ease;
}

.voice-mode-btn.voice-mode {
    background: linear-gradient(135deg, #ef4444, #f97316) !important;
    animation: voiceActive 2s ease-in-out infinite;
}

.voice-mode-btn.listening {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    animation: listeningPulse 1.5s ease-in-out infinite;
}

@keyframes voiceActive {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes listeningPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
        transform: scale(1.02);
    }
}

/* Mobile Voice Controls */
@media (max-width: 768px) {
    .voice-mode-indicator {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }

    #startVoiceBtn {
        padding: 12px 20px !important;
    }

    #startVoiceBtn span {
        font-size: 14px !important;
    }
}

/* Voice Feedback Animations */
.voice-feedback {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.voice-feedback.show {
    opacity: 1;
}

/* Voice Detector Animation */
.voice-detector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.9), rgba(20, 184, 166, 0.9));
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    backdrop-filter: blur(10px);
}

.voice-bar {
    width: 3px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: all 0.1s ease-out;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

.voice-bar.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Voice detector responsive */
@media (max-width: 768px) {
    .voice-detector {
        padding: 8px 16px;
        gap: 0.5px;
    }

    .voice-bar {
        width: 2px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Text Mode UI - Always visible */
#textModeUI {
    display: flex !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}
