/* Masar Academic Identity Styles */
:root {
    --ms-primary: #00205b; /* Dark Blue */
    --ms-primary-rgb: 0, 32, 91;
    --ms-secondary: #0078d4; /* Light Blue */
}

/* 🖼️ Professional Ambient Vector Watermark */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.05) 0%, rgba(0, 32, 91, 0.02) 50%, transparent 70%);
    border-radius: 50%;
    opacity: 0.8;
    z-index: -1;
    pointer-events: none;
}

.is-loading {
    border-color: var(--ms-primary) !important;
}

.validation-spinner {
    position: absolute;
    right: 12px;
    top: 38px;
    pointer-events: none;
}

/* Override primary button and link focus to match Masar Academic */
.btn-primary {
    background-color: var(--ms-primary) !important;
    border-color: var(--ms-primary) !important;
}

.btn-primary:hover {
    background-color: var(--ms-secondary) !important;
    border-color: var(--ms-secondary) !important;
}

.is-valid {
    border-color: #28c76f !important;
}

.is-invalid {
    border-color: #ea5455 !important;
}

/* 🎨 Modern Iconic System Brand Identity Component */
.app-brand-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    user-select: none;
}

.app-brand-identity:hover {
    transform: translateY(-1px);
}

.app-brand-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ms-primary) 0%, var(--ms-secondary) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 32, 91, 0.25);
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.app-brand-icon-wrapper::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    transform: rotate(30deg);
    pointer-events: none;
}

.app-brand-identity:hover .app-brand-icon-wrapper {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 6px 18px rgba(0, 120, 212, 0.4);
}

.app-brand-icon {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.app-brand-text-content {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ms-primary);
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Responsive Brand Sizing */
@media (max-width: 576px) {
    .app-brand-icon-wrapper {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .app-brand-icon {
        font-size: 1.15rem;
    }
    .app-brand-text-content {
        font-size: 1.1rem;
    }
}

/* Dark Mode Brand Adaptivity */
[data-bs-theme="dark"] .app-brand-icon-wrapper {
    background: linear-gradient(135deg, #003380 0%, #0088ff 100%);
    box-shadow: 0 4px 14px rgba(0, 136, 255, 0.3);
}

[data-bs-theme="dark"] .app-brand-text-content {
    color: #f1f5f9 !important;
}

/* Masar Academic Specific UI Touches */
.menu-vertical .menu-item.active > .menu-link {
    background-color: rgba(var(--ms-primary-rgb), 0.08) !important;
    color: var(--ms-primary) !important;
}

.menu-vertical .menu-item.active:not(.open) > .menu-link::before {
    background-color: var(--ms-primary) !important;
}

/* 🛡️ Professional RTL Sidebar Alignment Fix */
html[dir="rtl"] .menu-vertical .menu-link {
    flex-direction: row; /* Ensure icon is first (right) and text second (left) */
    justify-content: flex-start;
    text-align: right;
}

html[dir="rtl"] .menu-vertical .menu-icon {
    margin-left: 0.5rem;
    margin-right: 0 !important;
}

html[dir="rtl"] .menu-vertical .menu-sub .menu-link {
    padding-right: 3rem; /* Indent sub-items from the right */
}
