/* Bootstrap 5 Custom Styles with RTL Support - Dark Mode Only */

/* RTL Base Styles */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* RTL Bootstrap Adjustments */
[dir="rtl"] .navbar-nav {
    /* Removed flex-direction: row-reverse to maintain correct menu order */
}

[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
    text-align: right;
}

[dir="rtl"] .dropdown-menu-end {
    right: 0;
    left: auto;
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .me-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .ms-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1125;
}

::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d4a6f;
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

@keyframes gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@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);
    }
}

@keyframes gradient-text {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(226, 169, 56, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(226, 169, 56, 0.8);
    }
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out;
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-down {
    animation: slide-down 0.4s ease-out forwards;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 15s ease infinite;
}

.animate-blob {
    animation: blob 7s infinite;
}

.animate-gradient-text {
    background-size: 200% auto;
    animation: gradient-text 3s linear infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(226, 169, 56, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Input Focus Effects */
.form-control:focus,
.form-select:focus {
    transform: scale(1.02);
    border-color: #e2a938;
    box-shadow: 0 0 0 0.25rem rgba(226, 169, 56, 0.25);
}

/* Smooth Page Transitions */
body {
    animation: fade-in 0.5s ease-out;
    background-color: #090e21;
    color: #e0e0e0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    [dir="rtl"] .container {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, #e2a938, #f4b84a, #ffc857);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Morphism Effect */
.glass-effect {
    background: rgba(15, 22, 41, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 169, 56, 0.2);
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Hero Section Styles */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #090e21 0%, #0a1125 50%, #0f1629 100%);
}

.hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(226, 169, 56, 0.1) 0%, rgba(244, 184, 74, 0.05) 100%);
    opacity: 0.3;
}

/* Dashboard Stats Cards */
.stat-card {
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #0f1629, #151b2e);
    border: 1px solid #1a1f35;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(226, 169, 56, 0.3);
    border-color: #e2a938;
}

/* RTL Navbar Adjustments */
[dir="rtl"] .navbar-brand {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .navbar-nav .nav-link {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* Footer RTL Adjustments */
[dir="rtl"] .footer-links {
    text-align: right;
}

[dir="ltr"] .footer-links {
    text-align: left;
}

/* Registration Prompt Banner */
.registration-prompt {
    background: linear-gradient(135deg, rgba(226, 169, 56, 0.15), rgba(244, 184, 74, 0.1));
    border: 1px solid #e2a938;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.registration-prompt .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .registration-prompt {
        flex-direction: column;
        text-align: center;
    }
    
    .registration-prompt .btn {
        width: 100%;
    }
}

/* Chat Styles */
.chat-container {
    background-color: #0f1629;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #1a1f35;
}

.chat-header {
    background: linear-gradient(135deg, #0a1125, #0f1629);
    border-bottom: 1px solid #1a1f35;
}

.chat-messages {
    background: linear-gradient(to bottom, #090e21, #0f1629);
}

.message-bubble {
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 75%;
    word-wrap: break-word;
}

.user-message {
    background: linear-gradient(135deg, #e2a938, #f4b84a);
    color: #090e21;
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .user-message {
    margin-right: auto;
    margin-left: 0;
}

.counselor-message {
    background-color: #151b2e;
    color: #e0e0e0;
    border: 1px solid #1a1f35;
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .counselor-message {
    margin-left: auto;
    margin-right: 0;
}

/* Table Responsive Wrapper */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table-responsive table {
    margin-bottom: 0;
}

/* Form Styling */
.form-control,
.form-select {
    border-radius: 0.5rem;
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
}

[dir="rtl"] .input-group-text {
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Mobile Optimizations */
@media (max-width: 576px) {
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .display-1, .display-2, .display-3 {
        font-size: 2rem;
    }
}
