/* NDMO Assessment Platform - Custom Styles */

/* Root variables for consistent theming - Magnoos Inspired */
:root {
    --ndmo-primary: #1e40af;        /* Magnoos primary blue */
    --ndmo-secondary: #3b82f6;      /* Magnoos secondary blue */
    --ndmo-accent: #06b6d4;         /* Magnoos cyan accent */
    --ndmo-success: #10b981;        /* Modern green */
    --ndmo-danger: #ef4444;         /* Modern red */
    --ndmo-warning: #f59e0b;        /* Modern amber */
    --ndmo-info: #3b82f6;           /* Blue info */
    --ndmo-light: #f8fafc;          /* Slightly blue-tinted light */
    --ndmo-dark: #1e293b;           /* Modern dark blue-gray */
    --ndmo-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
    
    /* Override Bootstrap CSS variables */
    --bs-primary: #1e40af;
    --bs-secondary: #3b82f6;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #3b82f6;
    
    /* Custom spacing */
    --ndmo-section-padding: 2rem;
    --ndmo-card-padding: 1.5rem;
    
    /* Shadows */
    --ndmo-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --ndmo-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --ndmo-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Minimal custom overrides - use Bootstrap defaults where possible */

/* Custom card hover effects */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--ndmo-shadow);
}

/* Assessment progress indicators */
.progress-indicator {
    margin-bottom: 1rem;
}

.progress-indicator .progress {
    height: 10px;
    border-radius: 5px;
}

/* Question cards with enhanced visual hierarchy */
.question-card {
    border-left: 4px solid transparent;
    transition: border-color 0.3s ease;
}

.question-card.answered-yes {
    border-left-color: var(--bs-success);
}

.question-card.answered-no {
    border-left-color: var(--bs-danger);
}

.question-card.answered-partial {
    border-left-color: var(--bs-warning);
}

/* Assessment status badges */
.status-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Custom button group styling for answer options */
.answer-options .btn-check:checked + .btn {
    font-weight: 600;
}

/* Magnoos-inspired design enhancements */
.magnoos-gradient {
    background: var(--ndmo-gradient);
}

.btn-magnoos-primary {
    background: var(--ndmo-gradient);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-magnoos-primary:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    color: white;
}

.card-magnoos {
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card-magnoos:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.hero-magnoos {
    background: var(--ndmo-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-magnoos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-magnoos > * {
    position: relative;
    z-index: 1;
}

.text-magnoos-primary {
    color: var(--ndmo-primary) !important;
}

.text-magnoos-secondary {
    color: var(--ndmo-secondary) !important;
}

.text-magnoos-accent {
    color: var(--ndmo-accent) !important;
}

.bg-magnoos-primary {
    background-color: var(--ndmo-primary) !important;
}

.bg-magnoos-secondary {
    background-color: var(--ndmo-secondary) !important;
}

.bg-magnoos-accent {
    background-color: var(--ndmo-accent) !important;
}

.border-magnoos-primary {
    border-color: var(--ndmo-primary) !important;
}

/* Modern navbar styling */
.navbar-magnoos {
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1030;
}

.navbar-magnoos.scrolled {
    background: rgba(248, 250, 252, 0.98) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Domain grid layout enhancements */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Maturity level indicators */
.maturity-level {
    position: relative;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.maturity-level.current {
    background: var(--bs-primary-bg-subtle);
    border: 2px solid var(--bs-primary);
}

.maturity-level .level-number {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

/* Assessment navigation */
.assessment-nav {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* Custom alert styles for NDMO context */
.alert-ndmo {
    background-color: var(--bs-info-bg-subtle);
    border-color: var(--bs-info-border-subtle);
    color: var(--bs-info-text-emphasis);
}

/* Results dashboard enhancements */
.results-summary {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-primary-rgb));
    color: white;
    border-radius: 1rem;
    padding: var(--ndmo-section-padding);
}

.metric-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    transition: transform 0.2s ease;
}

.metric-card:hover {
    transform: scale(1.02);
}

.metric-card .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.metric-card .metric-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Table enhancements for better readability */
.table-assessment th {
    background-color: var(--bs-dark);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table-assessment td {
    vertical-align: middle;
    border-color: var(--bs-border-color-translucent);
}

/* Loading states */
.btn-loading {
    position: relative;
}

.btn-loading .spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    background: var(--bs-success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
}

/* Print styles for reports */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .metric-card .metric-value {
        font-size: 2rem;
    }
}

/* Dark mode specific adjustments */
[data-bs-theme="dark"] .question-card {
    background-color: var(--bs-dark-bg-subtle);
}

[data-bs-theme="dark"] .maturity-level.current {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
}

[data-bs-theme="dark"] .table-assessment th {
    background-color: var(--bs-gray-800);
}

/* Force text visibility fixes */
.text-muted {
    color: #212529 !important; /* Force black text instead of muted gray */
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

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

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .progress-bar {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .card-hover,
    .metric-card,
    .question-card,
    .fade-in,
    .slide-in-right {
        transition: none;
        animation: none;
    }
    
    .progress-bar {
        transition: none;
    }
}

/* RTL (Arabic) support */
[dir="rtl"] .navbar-brand {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .me-1,
[dir="rtl"] .me-2,
[dir="rtl"] .me-3 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-1,
[dir="rtl"] .ms-2,
[dir="rtl"] .ms-3 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

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

[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

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

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

[dir="rtl"] .border-left {
    border-right: 4px solid !important;
    border-left: none !important;
}

[dir="rtl"] .question-card {
    border-right: 4px solid transparent;
    border-left: none;
}

[dir="rtl"] .question-card.answered-yes {
    border-right-color: var(--bs-success);
}

[dir="rtl"] .question-card.answered-no {
    border-right-color: var(--bs-danger);
}

[dir="rtl"] .question-card.answered-partial {
    border-right-color: var(--bs-warning);
}

[dir="rtl"] .navbar-toggler {
    border: 1px solid rgba(0,0,0,.1);
}

/* Arabic font improvements */
[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-weight: 600;
}

/* Flip icons in RTL */
[dir="rtl"] .fa-chevron-right:before {
    content: "\f053";
}

/* ========================================
   Modern UI/UX Enhancements - 2025
   ======================================== */

/* Smooth Page Transitions */
.page-transition {
    animation: pageLoad 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Card Animations */
.card-animated {
    animation: cardEntrance 0.5s ease-out;
    animation-fill-mode: both;
}

.card-animated:nth-child(1) { animation-delay: 0.1s; }
.card-animated:nth-child(2) { animation-delay: 0.2s; }
.card-animated:nth-child(3) { animation-delay: 0.3s; }
.card-animated:nth-child(4) { animation-delay: 0.4s; }
.card-animated:nth-child(5) { animation-delay: 0.5s; }
.card-animated:nth-child(6) { animation-delay: 0.6s; }

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

/* Enhanced Button Interactions */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

/* Modern Badge Animations */
.badge {
    transition: all 0.2s ease;
}

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

/* Pulse Animation for Important Elements */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Notification Badge Pulse */
.badge.bg-danger {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(220, 53, 69, 0);
    }
}

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Progress Bar Animations */
.progress-bar {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-animated {
    background-size: 1rem 1rem;
}

/* Form Input Enhancements */
.form-control,
.form-select {
    transition: all 0.3s ease;
    border-width: 2px;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--ndmo-secondary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ndmo-primary);
    box-shadow: 0 0 0 0.25rem rgba(30, 64, 175, 0.15);
    transform: translateY(-1px);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1060;
    min-width: 300px;
    animation: toastSlideIn 0.4s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal Enhancements */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dropdown Animations */
.dropdown-menu {
    animation: dropdownSlideDown 0.2s ease-out;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1031;
}

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

/* Tooltip Enhancements */
.tooltip {
    animation: tooltipFade 0.2s ease;
}

@keyframes tooltipFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.9;
    }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--ndmo-primary), var(--ndmo-accent));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ndmo-gradient);
    color: white;
    border: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: statusBlink 2s infinite;
}

.status-dot.online {
    background-color: #10b981;
}

.status-dot.offline {
    background-color: #ef4444;
}

.status-dot.away {
    background-color: #f59e0b;
}

@keyframes statusBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Interactive Charts Hover */
canvas {
    transition: transform 0.2s ease;
}

canvas:hover {
    transform: scale(1.02);
}

/* Avatar Image Enhancements */
.avatar {
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Search Box Animations */
.search-box {
    position: relative;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    transform: scale(1.02);
}

.search-box input {
    transition: all 0.3s ease;
}

.search-box:focus-within input {
    padding-left: 2.5rem;
}

/* Table Row Hover Effects */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--ndmo-primary);
}

/* Accordion Enhancements */
.accordion-button:not(.collapsed) {
    background: var(--ndmo-gradient);
    color: white;
}

.accordion-button {
    transition: all 0.3s ease;
}

.accordion-collapse {
    animation: accordionExpand 0.3s ease-out;
}

@keyframes accordionExpand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Loading Spinner */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--ndmo-primary);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

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

/* Success Checkmark Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotateCircle 4.25s ease-in;
}

@keyframes rotateCircle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

/* Glow Effect */
.glow {
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

/* Floating Animation */
.float-animation {
    animation: floating 3s ease-in-out infinite;
}

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

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.5s;
}

/* Gradient Text Effect */
.gradient-text {
    background: var(--ndmo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--ndmo-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
}

/* Glass Morphism Effect */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Neumorphism Effect */
.neumorphism {
    background: #e0e5ec;
    box-shadow: 9px 9px 16px rgba(163,177,198,0.6), 
                -9px -9px 16px rgba(255,255,255, 0.5);
    border-radius: 1rem;
}

.neumorphism:hover {
    box-shadow: inset 9px 9px 16px rgba(163,177,198,0.6), 
                inset -9px -9px 16px rgba(255,255,255, 0.5);
}

/* Parallax Effect for Hero Section */
.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.parallax-layer.layer-1 {
    transform: translateZ(-1px) scale(2);
}

.parallax-layer.layer-2 {
    transform: translateZ(0) scale(1);
}

/* Enhanced Focus States for Accessibility */
*:focus-visible {
    outline: 3px solid var(--ndmo-accent);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Skip to Main Content Link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ndmo-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 0;
}

[dir="rtl"] .fa-chevron-left:before {
    content: "\f054";
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-gray-100);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* ================================================
   MODERN PROFESSIONAL AVATAR - Saeed the Consultant 
   ================================================ */

/* Modern Avatar Container */
.animated-avatar-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.1);
    border: 2px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

.animated-avatar-container.speaking {
    box-shadow: 0 6px 30px rgba(30, 64, 175, 0.2);
    border-color: rgba(30, 64, 175, 0.3);
    animation: subtle-pulse 2s ease-in-out infinite;
}

/* Professional Avatar Icon */
.avatar-icon {
    position: relative;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
}

.avatar-icon.speaking {
    animation: icon-speaking 1.5s ease-in-out infinite;
}

/* Professional User Symbol */
.avatar-symbol {
    color: white;
    font-size: 48px;
    font-weight: 300;
    opacity: 0.9;
}

/* Alternative: Modern geometric design */
.avatar-geometric {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-5deg);
    transition: all 0.3s ease;
}

.avatar-geometric.speaking {
    transform: rotate(5deg) scale(1.05);
    animation: geometric-pulse 1.5s ease-in-out infinite;
}

.avatar-geometric::before {
    content: 'S';
    color: white;
    font-size: 40px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Speaking indicator waves */
.speaking-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.wave {
    position: absolute;
    border: 2px solid rgba(30, 64, 175, 0.4);
    border-radius: 50%;
    animation: wave-expand 2s ease-out infinite;
}

.wave:nth-child(1) {
    width: 140px;
    height: 140px;
    top: -70px;
    left: -70px;
    animation-delay: 0s;
}

.wave:nth-child(2) {
    width: 170px;
    height: 170px;
    top: -85px;
    left: -85px;
    animation-delay: 0.3s;
}

.wave:nth-child(3) {
    width: 200px;
    height: 200px;
    top: -100px;
    left: -100px;
    animation-delay: 0.6s;
}

/* Modern Avatar Animations */
@keyframes subtle-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 6px 30px rgba(30, 64, 175, 0.2);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 8px 35px rgba(30, 64, 175, 0.25);
    }
}

@keyframes icon-speaking {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
    }
    25% { 
        transform: scale(1.05) rotate(1deg);
    }
    75% { 
        transform: scale(1.05) rotate(-1deg);
    }
}

@keyframes geometric-pulse {
    0%, 100% { 
        transform: rotate(5deg) scale(1.05);
    }
    50% { 
        transform: rotate(-2deg) scale(1.08);
    }
}

@keyframes wave-expand {
    0% {
        opacity: 0.6;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* Professional Status Indicator */
.avatar-status {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.avatar-status.speaking {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    animation: status-glow 1.5s ease-in-out infinite;
}

.avatar-status.listening {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    animation: status-glow 1s ease-in-out infinite;
}

@keyframes status-glow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    }
}

/* Status indicator for avatar */
.avatar-status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.avatar-status-indicator.speaking {
    background: #ffc107;
    animation: status-pulse 1s ease-in-out infinite;
}

.avatar-status-indicator.listening {
    background: #17a2b8;
    animation: status-pulse 0.5s ease-in-out infinite;
}

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

/* Responsive avatar sizing */
@media (max-width: 768px) {
    .animated-avatar-container {
        width: 150px;
        height: 150px;
    }
    
    .avatar-face {
        width: 110px;
        height: 130px;
    }
}

/* RTL Support for Avatar */
[dir="rtl"] .avatar-collar {
    border-top: 3px solid #1e40af;
}

[dir="rtl"] .eyebrow {
    transform: rotate(15deg);
}

[dir="rtl"] .eyebrow.right {
    transform: rotate(-15deg);
}
