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

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #ffffff;
    direction: rtl;
    overflow: hidden;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: rgba(17, 17, 17, 0.95);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 255, 157, 0.15), 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(51, 51, 51, 0.5);
    backdrop-filter: blur(15px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

    .chat-container:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 50px rgba(0, 255, 157, 0.2), 0 4px 20px rgba(0, 0, 0, 0.4);
    }

.chat-header {
    padding: 1.25rem 1.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(51, 51, 51, 0.7);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #00ff9d;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.8);
}

.status-text {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    background: rgba(17, 17, 17, 0.95);
    scroll-behavior: smooth;
    background-image: radial-gradient(circle at 25% 25%, rgba(0, 255, 157, 0.03) 0%, transparent 50%), radial-gradient(circle at 75% 75%, rgba(0, 255, 157, 0.03) 0%, transparent 50%);
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

    .message.user {
        justify-content: flex-start;
    }

    .message.ai {
        justify-content: flex-end;
    }

.message-bubble {
    max-width: 80%;
    padding: 1.1rem 1.35rem;
    border-radius: 1.2rem;
    font-size: 1rem;
    line-height: 1.6;
    transition: all 0.3s ease;
    text-align: right;
    letter-spacing: 0;
    font-weight: 400;
    position: relative;
    overflow: hidden;
}

    .message-bubble:hover {
        transform: scale(1.02);
    }

.ai .message-bubble {
    background: linear-gradient(135deg, #00ff9d 0%, #00cc7d 100%);
    color: #000000;
    border-top-left-radius: 0.4rem;
    border-bottom-left-radius: 1.2rem;
    border-top-right-radius: 0;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 255, 157, 0.25);
}

    .ai .message-bubble::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0.5;
        pointer-events: none;
    }

.user .message-bubble {
    background: rgba(34, 34, 34, 0.97);
    color: #ffffff;
    border-top-right-radius: 0.4rem;
    border-bottom-right-radius: 1.2rem;
    border-top-left-radius: 0;
    border: 1px solid rgba(51, 51, 51, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .user .message-bubble::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 50%;
        height: 1px;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.1), transparent);
    }

.chat-footer {
    padding: 1.25rem 1.75rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(51, 51, 51, 0.7);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(51, 51, 51, 0.8);
    border-radius: 999px;
    font-size: 1rem;
    background: rgba(34, 34, 34, 0.97);
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

    input:focus {
        outline: none;
        border-color: rgba(0, 255, 157, 0.7);
        box-shadow: 0 0 0 4px rgba(0, 255, 157, 0.15), inset 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    input:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    input::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

.send-button {
    background: linear-gradient(135deg, #00ff9d 0%, #00cc7d 100%);
    color: #000000;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 157, 0.25);
    position: relative;
    overflow: hidden;
}

    .send-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0.5;
        transition: opacity 0.3s ease;
    }

    .send-button:hover:not(:disabled)::before {
        opacity: 0.7;
    }

    .send-button:hover:not(:disabled) {
        transform: scale(1.08);
        box-shadow: 0 6px 16px rgba(0, 255, 157, 0.35);
    }

    .send-button:active:not(:disabled) {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 255, 157, 0.2);
    }

    .send-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .send-button svg {
        width: 24px;
        height: 24px;
        transition: transform 0.3s ease;
        position: relative;
        z-index: 2;
    }

    .send-button:hover:not(:disabled) svg {
        transform: translateX(3px);
    }

.input-info {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
        box-shadow: 0 0 15px rgba(0, 255, 157, 0.5);
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow: 0 0 25px rgba(0, 255, 157, 0.8);
    }

    100% {
        transform: scale(0.95);
        opacity: 0.5;
        box-shadow: 0 0 15px rgba(0, 255, 157, 0.5);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(34, 34, 34, 0.5);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(51, 51, 51, 0.8);
    border-radius: 4px;
    transition: background 0.3s ease;
}

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 255, 157, 0.4);
    }

/* Glass morphism effect for containers */
.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0.5;
}

/* Animation for messages */
@keyframes slideIn {
    from {
        transform: translateY(25px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation for loading dots when AI is typing */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(34, 34, 34, 0.97);
    border-radius: 12px;
    margin-right: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 255, 157, 0.7);
    border-radius: 50%;
    opacity: 0.4;
}

    .typing-dot:nth-child(1) {
        animation: typingDot 1.4s infinite 0s;
    }

    .typing-dot:nth-child(2) {
        animation: typingDot 1.4s infinite 0.2s;
    }

    .typing-dot:nth-child(3) {
        animation: typingDot 1.4s infinite 0.4s;
    }

@keyframes typingDot {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

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

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

/* New styles for better mobile responsiveness */
@media (max-width: 768px) {
    .chat-container {
        height: 95vh;
        border-radius: 20px;
    }

    .chat-messages {
        padding: 1.5rem;
    }

    .message-bubble {
        max-width: 85%;
        padding: 1rem 1.2rem;
    }

    .chat-header,
    .chat-footer {
        padding: 1rem 1.25rem;
    }

    input {
        padding: 0.9rem 1.25rem;
    }

    .send-button {
        width: 48px;
        height: 48px;
    }
}

/* Added subtle background animation */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(0, 255, 157, 0.03) 0%, transparent 70%), radial-gradient(circle at 90% 80%, rgba(0, 255, 157, 0.03) 0%, transparent 70%);
    opacity: 0.5;
    animation: backgroundPulse 15s ease infinite alternate;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.6;
    }
}

/* Clear all previous navigation styles */
.navigation-buttons,
.nav-button,
.footer-info-row,
.nav-links,
.nav-link {
    display: none;
}

/* Simple, direct fix for button spacing */
.footer-nav {
    display: flex;
    justify-content: space-between; /* This creates the maximum space between elements */
    width: 100%;
    margin-top: 15px;
}

    .footer-nav a {
        color: #000000;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 600;
        padding: 8px 18px;
        border-radius: 999px;
        background: linear-gradient(135deg, #00ff9d 0%, #00cc7d 100%);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 255, 157, 0.2);
        text-align: center;
        width: 30%; /* Fixed width for each button */
        max-width: 180px;
    }

        /* All the hover, before, after styles remain the same */
        .footer-nav a::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
            opacity: 0.5;
            transition: opacity 0.3s ease;
        }

        .footer-nav a:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(0, 255, 157, 0.35);
        }

            .footer-nav a:hover::before {
                opacity: 0.7;
            }

        .footer-nav a:active {
            transform: translateY(1px);
            box-shadow: 0 2px 8px rgba(0, 255, 157, 0.2);
        }

        .footer-nav a::after {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(135deg, #00ff9d 0%, #00cc7d 100%);
            z-index: -1;
            border-radius: 999px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .footer-nav a:hover::after {
            opacity: 0.4;
            animation: glowing 1.5s infinite alternate;
        }

/* Media query for mobile responsiveness */
@media (max-width: 768px) {
    .footer-nav {
        justify-content: center;
        gap: 15px;
    }

        .footer-nav a {
            flex: 1;
            max-width: 45%;
        }
}
/* Navigation Bar Styles */
.student-navbar {
    background-color: #061121; /* Darker background to match body */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 20px;
    border-bottom: 3px solid #00ff9d; /* Using direct color instead of var */
}

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

.nav-logo {
    display: flex;
    align-items: center;
    color: #00ff9d; /* Using direct color instead of var */
    font-weight: 700;
    font-size: 1.2rem;
}

    .nav-logo i {
        font-size: 1.5rem;
        margin-left: 0.5rem;
        animation: pulse 2s infinite;
    }

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem; /* Direct value instead of var */
    transition: all 0.4s ease; /* Direct value instead of var */
    position: relative;
}

    .nav-link i {
        margin-left: 0.5rem;
        font-size: 1rem;
    }

    .nav-link:hover {
        color: #00ff9d; /* Using direct color instead of var */
        background-color: rgba(0, 255, 157, 0.1);
    }

.active-link {
    color: #00ff9d; /* Using direct color instead of var */
    font-weight: bold;
    background-color: rgba(0, 255, 157, 0.1);
}

.nav-link .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #00ff9d; /* Using direct color instead of var */
    color: #0f172a; /* Using direct color instead of var */
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-user {
    display: flex;
    align-items: center;
}

.user-info {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem; /* Direct value instead of var */
    color: white;
    transition: all 0.4s ease; /* Direct value instead of var */
}

    .user-toggle:hover {
        background-color: rgba(0, 255, 157, 0.1);
        color: #00ff9d; /* Using direct color instead of var */
    }

    .user-toggle i.fa-user-circle {
        font-size: 1.2rem;
        margin-left: 0.5rem;
    }

    .user-toggle i.fa-chevron-down {
        font-size: 0.8rem;
        margin-right: 0.5rem;
    }

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1e293b; /* Direct value instead of var */
    border-radius: 0.75rem; /* Direct value instead of var */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1001;
    display: none;
    border: 1px solid #334155; /* Direct value instead of var */
}

    .dropdown-menu.show {
        display: block;
    }

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.4s ease; /* Direct value instead of var */
    font-size: 0.95rem;
    background: none;
    border: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
}

    .dropdown-item i {
        margin-left: 0.75rem;
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }

    .dropdown-item:hover {
        background-color: rgba(0, 255, 157, 0.1);
        color: #00ff9d; /* Using direct color instead of var */
    }

.logout-btn {
    color: #f87171 !important; /* Direct value instead of var */
    border-top: 1px solid #334155; /* Direct value instead of var */
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

    .logout-btn:hover {
        background-color: rgba(244, 67, 54, 0.1) !important;
    }

.auth-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #00ff9d; /* Using direct color instead of var */
    color: #00ff9d; /* Using direct color instead of var */
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem; /* Direct value instead of var */
    text-decoration: none;
    transition: all 0.4s ease; /* Direct value instead of var */
}

    .btn-outline:hover {
        background-color: #00ff9d; /* Using direct color instead of var */
        color: #0f172a; /* Direct value instead of var */
    }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .nav-user {
        width: 100%;
        justify-content: center;
    }

    .auth-buttons {
        width: 100%;
        justify-content: center;
    }
}


.rtl-chat {
    direction: rtl;
}

/* Direction-specific bubbles for English */
.ltr-chat .message.user {
    justify-content: flex-end !important;
}

.ltr-chat .message.ai {
    justify-content: flex-start !important;
}

.ltr-chat .user .message-bubble {
    border-top-left-radius: 0.4rem !important;
    border-bottom-left-radius: 1.2rem !important;
    border-top-right-radius: 0 !important;
    text-align: left;
}

.ltr-chat .ai .message-bubble {
    border-top-right-radius: 0.4rem !important;
    border-bottom-right-radius: 1.2rem !important;
    border-top-left-radius: 0 !important;
    text-align: left;
}

.ltr-chat .user .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), transparent);
}

/* Font adjustments - using system fonts for English to improve readability */
.ltr-chat body,
.ltr-chat input,
.ltr-chat button {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Keep Cairo font for Arabic */
.rtl-chat body,
.rtl-chat input,
.rtl-chat button {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Language-specific list formatting */
.ltr-chat .list-item {
    text-align: left;
}

.rtl-chat .list-item {
    text-align: right;
}

.ltr-chat .list-marker {
    margin-right: 8px;
    margin-left: 0;
}

.rtl-chat .list-marker {
    margin-left: 8px;
    margin-right: 0;
}

/* Improve RTL/LTR link containers */
.ltr-chat .link-container {
    text-align: left;
    border-left: 3px solid #4da6ff;
    border-right: none;
}

.rtl-chat .link-container {
    text-align: right;
    border-right: 3px solid #4da6ff;
    border-left: none;
}

/* Footer nav adjustments */
.ltr-chat .footer-nav {
    flex-direction: row;
}

.rtl-chat .footer-nav {
    flex-direction: row-reverse;
}