/* UALS Global Styles - Neural Network Theme */
/* Advanced animations and effects for the futuristic AI learning platform */

/* Glowing text effect for important elements */
.glow-text {
    text-shadow: 0 0 10px rgba(134, 111, 255, 0.6),
                 0 0 20px rgba(134, 111, 255, 0.4),
                 0 0 30px rgba(134, 111, 255, 0.3);
}

/* Pulsing animation for active elements */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(134, 111, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(134, 111, 255, 0.8),
                    0 0 30px rgba(134, 111, 255, 0.6);
    }
}

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

/* Holographic border effect */
.holographic-border {
    position: relative;
    background: linear-gradient(45deg, transparent, rgba(134, 111, 255, 0.1), transparent);
}

.holographic-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #865fff, #4338ca, #0ea5e9, #22c55e, #f59e0b, #ef4444);
    background-size: 300% 300%;
    opacity: 0.3;
    z-index: -1;
    filter: blur(1px);
    animation: gradient-shift 3s ease infinite;
}

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

/* Advanced loading animations */
.neural-loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.neural-loading div {
    position: absolute;
    border: 4px solid rgba(134, 111, 255, 0.2);
    border-radius: 50%;
    border-top: 4px solid #865fff;
    animation: neural-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.neural-loading div:nth-child(1) { animation-delay: -0.45s; }
.neural-loading div:nth-child(2) { animation-delay: -0.3s; }
.neural-loading div:nth-child(3) { animation-delay: -0.15s; }

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

/* Content fade-in animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

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

/* Interactive hover effects for learning content */
.interactive-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.interactive-content:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

/* Neural network connection lines animation */
.connection-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(134, 111, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(67, 56, 202, 0.1) 1px, transparent 1px),
        linear-gradient(45deg, rgba(134, 111, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 100px 100px;
    animation: connection-flow 20s linear infinite;
}

@keyframes connection-flow {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 50px 50px, 80px 80px, 100px 100px; }
}

/* Glitch effect for error states */
.glitch-effect {
    position: relative;
    color: #ffffff;
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Success state animations */
.success-bounce {
    animation: successBounce 0.6s ease-out;
}

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

/* Large button styling */
.btn-lg {
    padding: 16px 32px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 25px rgba(134, 111, 255, 0.4) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-lg:hover {
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 12px 35px rgba(134, 111, 255, 0.5) !important;
}

/* Quick links styling for landing page cards */
.quick-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-links h4 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.link-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-link {
    display: block;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.system-card[data-system="KE"] .quick-link:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.system-card[data-system="SPL"] .quick-link:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.system-card[data-system="SBCAT"] .quick-link:hover {
    background: rgba(134, 111, 255, 0.15);
    border-color: rgba(134, 111, 255, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(134, 111, 255, 0.3);
}

.quick-link:active {
    transform: translateY(0);
}

/* Compact suggestion interface */
.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-group input {
    flex: 1;
}

.suggestion-btn-small {
    width: 36px;
    height: 36px;
    background: rgba(134, 111, 255, 0.2);
    border: 1px solid rgba(134, 111, 255, 0.4);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.suggestion-btn-small:hover {
    background: rgba(134, 111, 255, 0.3);
    border-color: rgba(134, 111, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(134, 111, 255, 0.3);
}

.suggestion-btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.suggestions-dropdown {
    position: relative;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
}

.suggestions-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

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

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(134, 111, 255, 0.15);
    color: #ffffff;
}

.suggestion-item:active {
    background: rgba(134, 111, 255, 0.25);
}

.suggestions-loading {
    padding: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.suggestions-loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(134, 111, 255, 0.3);
    border-top: 2px solid #865fff;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

.suggestions-error {
    padding: 16px;
    text-align: center;
    color: rgba(239, 68, 68, 0.8);
    font-size: 14px;
}

/* =======================================================================
   RTL (Right-to-Left) Support - Arabic, Hebrew, Persian, Urdu
   ======================================================================= */

/* RTL Global Layout */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] * {
    text-align: inherit;
}

.rtl-layout {
    direction: rtl;
}

.ltr-layout {
    direction: ltr;
}

/* RTL Text and Content Alignment */
[dir="rtl"] .container,
[dir="rtl"] .header,
[dir="rtl"] .main-content,
[dir="rtl"] .system-grid,
[dir="rtl"] .philosophy-selector {
    text-align: right;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, 
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    text-align: right;
}

[dir="rtl"] p, [dir="rtl"] div, [dir="rtl"] span {
    text-align: right;
}

/* RTL Header Layout */
[dir="rtl"] .header {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-controls {
    flex-direction: row-reverse;
}

/* RTL Language Selector */
[dir="rtl"] .language-selector select {
    text-align: right;
    padding-left: 30px;
    padding-right: 14px;
    background-position: 10% center;
}

/* RTL Button and Control Alignment */
[dir="rtl"] .btn, 
[dir="rtl"] button {
    text-align: center;
}

[dir="rtl"] .btn-lg {
    text-align: center;
}

/* RTL System Cards */
[dir="rtl"] .system-grid {
    direction: rtl;
}

[dir="rtl"] .system-card {
    text-align: right;
}

[dir="rtl"] .system-card h3 {
    text-align: right;
}

[dir="rtl"] .system-card p {
    text-align: right;
}

/* RTL Quick Links */
[dir="rtl"] .quick-links {
    text-align: right;
}

[dir="rtl"] .quick-links h4 {
    text-align: center;
}

[dir="rtl"] .quick-link {
    text-align: center;
}

/* RTL Input Groups and Forms */
[dir="rtl"] .input-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .input-group input {
    text-align: right;
    padding-left: 12px;
    padding-right: 16px;
}

[dir="rtl"] .suggestion-btn-small {
    margin-left: 0;
    margin-right: 0;
}

/* RTL Suggestions Dropdown */
[dir="rtl"] .suggestions-dropdown {
    right: 0;
    left: auto;
    text-align: right;
}

[dir="rtl"] .suggestion-item {
    text-align: right;
    padding: 12px 16px;
}

/* RTL Modal and Dialog Systems */
[dir="rtl"] .modal {
    direction: rtl;
}

[dir="rtl"] .modal-header {
    text-align: right;
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-header .close {
    margin-left: 0;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 0;
}

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

[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-footer .btn {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .modal-footer .btn:first-child {
    margin-left: 0;
}

/* RTL Navigation and Menu Items */
[dir="rtl"] nav,
[dir="rtl"] .nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-item {
    text-align: right;
}

[dir="rtl"] .nav-link {
    text-align: right;
    padding-left: 1rem;
    padding-right: 0.75rem;
}

/* RTL Float and Positioning */
[dir="rtl"] .float-left {
    float: right !important;
}

[dir="rtl"] .float-right {
    float: left !important;
}

[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

/* RTL Margin and Padding Utilities */
[dir="rtl"] .ml-1 { margin-left: 0; margin-right: 0.25rem; }
[dir="rtl"] .ml-2 { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .ml-4 { margin-left: 0; margin-right: 1.5rem; }
[dir="rtl"] .ml-5 { margin-left: 0; margin-right: 3rem; }

[dir="rtl"] .mr-1 { margin-right: 0; margin-left: 0.25rem; }
[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 1rem; }
[dir="rtl"] .mr-4 { margin-right: 0; margin-left: 1.5rem; }
[dir="rtl"] .mr-5 { margin-right: 0; margin-left: 3rem; }

[dir="rtl"] .pl-1 { padding-left: 0; padding-right: 0.25rem; }
[dir="rtl"] .pl-2 { padding-left: 0; padding-right: 0.5rem; }
[dir="rtl"] .pl-3 { padding-left: 0; padding-right: 1rem; }
[dir="rtl"] .pl-4 { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .pl-5 { padding-left: 0; padding-right: 3rem; }

[dir="rtl"] .pr-1 { padding-right: 0; padding-left: 0.25rem; }
[dir="rtl"] .pr-2 { padding-right: 0; padding-left: 0.5rem; }
[dir="rtl"] .pr-3 { padding-right: 0; padding-left: 1rem; }
[dir="rtl"] .pr-4 { padding-right: 0; padding-left: 1.5rem; }
[dir="rtl"] .pr-5 { padding-right: 0; padding-left: 3rem; }

/* RTL Border Utilities */
[dir="rtl"] .border-left {
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[dir="rtl"] .border-right {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* RTL Learning Interface Specific Styles */
[dir="rtl"] .learning-interface {
    direction: rtl;
}

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

[dir="rtl"] .question-container {
    text-align: right;
}

[dir="rtl"] .answer-options {
    text-align: right;
}

[dir="rtl"] .answer-option {
    text-align: right;
    padding-left: 15px;
    padding-right: 40px;
}

[dir="rtl"] .answer-option::before {
    left: auto;
    right: 15px;
}

/* RTL Chat and Message Interfaces */
[dir="rtl"] .chat-container {
    direction: rtl;
}

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

[dir="rtl"] .message-user {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
}

[dir="rtl"] .message-assistant {
    margin-right: 0;
    margin-left: auto;
    text-align: right;
}

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

/* RTL Progress Indicators */
[dir="rtl"] .progress {
    transform: scaleX(-1);
}

[dir="rtl"] .progress-bar {
    transform: scaleX(-1);
}

/* RTL Dropdown Menus */
[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
    padding-left: 1.5rem;
    padding-right: 1rem;
}

/* RTL Icons and Arrows */
[dir="rtl"] .icon-arrow-left::before {
    content: "→";
}

[dir="rtl"] .icon-arrow-right::before {
    content: "←";
}

[dir="rtl"] .arrow-left {
    transform: scaleX(-1);
}

[dir="rtl"] .arrow-right {
    transform: scaleX(-1);
}

/* RTL Flex Adjustments */
[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .justify-content-start {
    justify-content: flex-end;
}

[dir="rtl"] .justify-content-end {
    justify-content: flex-start;
}

/* RTL Table Adjustments */
[dir="rtl"] table {
    text-align: right;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .table th:first-child,
[dir="rtl"] .table td:first-child {
    padding-left: 0.75rem;
    padding-right: 0;
}

[dir="rtl"] .table th:last-child,
[dir="rtl"] .table td:last-child {
    padding-right: 0.75rem;
    padding-left: 0;
}

/* RTL Animation Adjustments */
[dir="rtl"] @keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

[dir="rtl"] @keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

[dir="rtl"] .slide-in-left {
    animation-name: slideInRight;
}

[dir="rtl"] .slide-in-right {
    animation-name: slideInLeft;
}

/* RTL Loading and Spinner Adjustments */
[dir="rtl"] .spinner {
    animation-direction: reverse;
}

[dir="rtl"] .neural-loading div {
    animation-direction: reverse;
}

/* RTL Philosophy Toggle Specific */
[dir="rtl"] .philosophy-toggle {
    flex-direction: row-reverse;
}

[dir="rtl"] .toggle-option {
    text-align: center;
}

/* RTL Responsive Breakpoints */
@media (max-width: 768px) {
    [dir="rtl"] .header {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    [dir="rtl"] .header-controls {
        flex-direction: row-reverse;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    [dir="rtl"] .system-grid {
        direction: rtl;
    }
}

/* RTL Font Optimization for Arabic Script */
[dir="rtl"][lang="ar"],
[dir="rtl"][lang="ar"] * {
    font-family: 'Noto Sans Arabic', 'Amiri', 'Scheherazade', 'Arial Unicode MS', sans-serif;
    line-height: 1.8;
    letter-spacing: 0.02em;
}

/* RTL Font Optimization for Hebrew */
[dir="rtl"][lang="he"],
[dir="rtl"][lang="he"] * {
    font-family: 'Noto Sans Hebrew', 'David CLM', 'FrankRuehl CLM', Arial, sans-serif;
    line-height: 1.6;
}

/* RTL Font Optimization for Persian/Farsi */
[dir="rtl"][lang="fa"],
[dir="rtl"][lang="fa"] * {
    font-family: 'Noto Sans Arabic', 'Iranian Sans', 'Tahoma', Arial, sans-serif;
    line-height: 1.8;
}

/* RTL Font Optimization for Urdu */
[dir="rtl"][lang="ur"],
[dir="rtl"][lang="ur"] * {
    font-family: 'Noto Sans Arabic', 'Jameel Noori Nastaleeq', 'Nafees Web Naskh', Arial, sans-serif;
    line-height: 2.0;
}
/* Wizard Button Styles */
.wizard-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wizard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.wizard-btn:active {
    transform: translateY(0);
}

.system-card .wizard-btn {
    margin-top: auto;
}

