:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #1e293b;
    margin: 0;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
}

.navbar {
    z-index: 1050;
    /* Higher than other glass panels */
}

.dropdown-menu {
    z-index: 1100 !important;
}

.dropdown-menu.glass-panel {
    position: absolute;
}

.premium-card {
    background: white;
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.1);
}

/* Luxury Buttons */
.btn-premium {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-premium:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

/* Sidebar Styling */
[dir="rtl"] .sidebar-glass {
    border-left: 1px solid var(--glass-border);
}

[dir="ltr"] .sidebar-glass {
    border-right: 1px solid var(--glass-border);
}

.sidebar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    height: 100vh;
}

/* ========================================
   MODERN CREATIVE LOADING PAGE
   ======================================== */

/* Loading Container - Gradient Background */
.loading-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.loading-container.fade-out {
    opacity: 0;
    transform: scale(1.02);
}

/* Animated Background Grid */
.animated-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    perspective: 1000px;
}

.grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    animation: gridMove 8s ease-in-out infinite;
}

.grid-line:nth-child(1) {
    width: 2px;
    height: 100%;
    left: 20%;
    animation-delay: 0s;
}

.grid-line:nth-child(2) {
    width: 2px;
    height: 100%;
    left: 50%;
    animation-delay: 2s;
}

.grid-line:nth-child(3) {
    width: 100%;
    height: 2px;
    top: 30%;
    animation-delay: 1s;
}

.grid-line:nth-child(4) {
    width: 100%;
    height: 2px;
    top: 70%;
    animation-delay: 3s;
}

@keyframes gridMove {

    0%,
    100% {
        opacity: 0.1;
        transform: translateZ(0) scale(1);
    }

    50% {
        opacity: 0.3;
        transform: translateZ(20px) scale(1.02);
    }
}

/* Floating Decorative Shapes - Enhanced */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    animation: float 25s infinite ease-in-out;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 65%;
    left: 75%;
    animation-delay: 3s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    top: 35%;
    left: 80%;
    animation-delay: 6s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 55%;
    left: 15%;
    animation-delay: 2s;
}

.shape-5 {
    width: 90px;
    height: 90px;
    top: 10%;
    left: 70%;
    animation-delay: 4s;
}

.shape-6 {
    width: 110px;
    height: 110px;
    top: 80%;
    left: 50%;
    animation-delay: 5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(calc(var(--mouse-x, 0) * -30px), calc(var(--mouse-y, 0) * -30px)) rotate(0deg) scale(1);
        opacity: 0.4;
    }

    25% {
        transform: translate(calc(var(--mouse-x, 0) * -30px + 20px), calc(var(--mouse-y, 0) * -30px - 40px)) rotate(90deg) scale(1.1);
        opacity: 0.6;
    }

    50% {
        transform: translate(calc(var(--mouse-x, 0) * -30px - 30px), calc(var(--mouse-y, 0) * -30px - 80px)) rotate(180deg) scale(0.9);
        opacity: 0.4;
    }

    75% {
        transform: translate(calc(var(--mouse-x, 0) * -30px - 50px), calc(var(--mouse-y, 0) * -30px - 40px)) rotate(270deg) scale(1.05);
        opacity: 0.6;
    }
}

/* Light Beams - Decorative Effect */
.light-beams {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.beam {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: beamMove 4s linear infinite;
}

.beam-1 {
    left: 25%;
    animation-delay: 0s;
}

.beam-2 {
    left: 50%;
    animation-delay: 1.3s;
}

.beam-3 {
    left: 75%;
    animation-delay: 2.6s;
}

@keyframes beamMove {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Enhanced Glass Loader Container */
.glass-loader {
    padding: 60px 70px;
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(25px);
    border-radius: 35px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 2;
    min-width: 380px;
    max-width: 450px;
    overflow: hidden;
    /* For glass glint */
    animation: slideInScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Glass Glint Shimmer Effect */
.glass-glint {
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.2),
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: skewX(-25deg);
    animation: glassGlint 4s infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes glassGlint {
    0% {
        left: -150%;
    }

    30% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes slideInScale {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loader Icon Container with Pulsing Rings */
.loader-icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.loader-icon {
    position: relative;
    z-index: 3;
    color: #ffffff;
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotate3D 3s ease-in-out infinite;
}

@keyframes rotate3D {

    0%,
    100% {
        transform: rotateY(0deg) scale(1);
    }

    50% {
        transform: rotateY(180deg) scale(1.1);
    }
}

/* Pulsing Rings Around Icon */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-ring-1 {
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.pulse-ring-2 {
    width: 80px;
    height: 80px;
    animation-delay: 0.5s;
}

.pulse-ring-3 {
    width: 80px;
    height: 80px;
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Brand Name with Gradient */
.brand-name {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0 5px;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}

.brand-subtitle {
    font-size: 20px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 30px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Loading Text Container */
.loading-text-container {
    margin: 25px 0;
}

.loading-text {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 15px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    opacity: 1;
    /* Default opacity */
    transition: opacity 0.5s ease-in-out;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 3.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Dots Animation */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Infinite Progress Bar */
.progress-container-infinite {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 30px 0 20px;
    position: relative;
}

.progress-bar-infinite {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.4) 100%);
    border-radius: 10px;
    animation: infiniteSlide 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

@keyframes infiniteSlide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(350%);
    }
}

/* Status Text */
.status-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Custom Inputs */
.form-control-premium {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control-premium:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

/* Blazor Error UI - Hidden by default, shown only when there's an error */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    color: inherit;
    text-decoration: underline;
}

#blazor-error-ui.show {
    display: block;
}