﻿/* 
 * W4LCRM Consolidated CSS Architecture
 * Created from app.css + style.css cleanup and modernization
 * Removes 78 vendor prefixes, consolidates duplicates, modernizes patterns
 */

/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
    /* Color System - Consolidated from 32+ hardcoded colors */
    --primary: #1b6ec2;
    --primary-hover: #1861ac;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* App Specific Colors */
    --app-purple: #83039e;
    --app-cerulean: #109fcd;
    --sidebar-bg: #304250;
    --sidebar-active: rgba(255,255,255,0.25);
    --sidebar-hover: rgba(255,255,255,0.1);
    --topbar-bg: #f7f7f7;
    --border-color: #d6d5d5;

    /* Typography */
    --font-family-primary: 'Roboto', sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.42857143;

    /* Z-index System - Comprehensive modal fix hierarchy */
    --z-sidebar: 1000;
    --z-topbar: 1010;
    --z-modal: 1050;
    --z-tooltip: 1070;
    --z-error-ui: 1200;
    --z-fullscreen: 1060;
    
    /* Modal Dialog Stack - Bootstrap modals only (Syncfusion dialogs migrated) */
    --z-dropdown-modal: 1300;  /* SfDropDownList/SfMultiSelect popups still used */
    
    /* DEPRECATED: Syncfusion dialog variables - no longer needed */
    /* --z-bootstrap-backdrop: 19990; */
    /* --z-syncfusion-overlay: 20000; */
    /* --z-syncfusion-dialog: 20001; */

    /* Spacing */
    --sidebar-width: 250px;
    --topbar-height: 3.5rem;
}

/* ===== FONT FACE DECLARATIONS ===== */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

@font-face {
    font-family: 'Roboto';
    src: url('../font/anMUvcNT0H1YN4FII8wpr24bNCNEoFTpS2BTjF6FB5E.woff') format('woff');
    font-display: swap; /* Performance improvement */
}

/* ===== BASE STYLES ===== */
html, body {
    font-family: var(--font-family-primary) !important;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

/* ===== LAYOUT SYSTEM ===== */
app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
}

.top-row {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
}

.main .top-row {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-end;
}

.main .top-row > a, 
.main .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
}

.main .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar {
    background-color: var(--sidebar-bg);
}

.sidebar .top-row {
    background-color: rgba(0,0,0,0.4);
}

.sidebar .navbar-brand {
    font-size: 1.1rem;
}

.sidebar .oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item a {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.sidebar .nav-item a.active {
    background-color: var(--sidebar-active);
    color: var(--white);
}

.sidebar .nav-item a:hover {
    background-color: var(--sidebar-hover);
    color: var(--white);
}

.content {
    padding-top: 4.1rem;
}

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== BUTTONS - CONSOLIDATED ===== */
/* Primary button - single definition (resolved duplicate) */
.btn-primary {
    color: var(--white);
    background-color: var(--primary);
    border-color: var(--primary-hover);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Custom button variants from style.css */
.btn-bgCustomLightGreen {
    background-color: #eafaf1;
    color: var(--gray-700);
}

.btn-adjust-font {
    font-weight: normal;
    letter-spacing: 0.05em;
    font-size: 1em;
    padding: 0.5em 1em;
}

/* ===== LINKS ===== */
a, .btn-link {
    color: #0366d6;
}

.hiperlink {
    text-decoration-line: underline;
    text-decoration-color: dodgerblue;
    cursor: pointer;
}

.grid-text-button {
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
}

.grid-text-button:hover {
    color: #0056b3;
}

/* ===== UTILITY CLASSES ===== */
.cursor-pointer {
    cursor: pointer;
}

.app-color-Purple {
    color: var(--app-purple) !important;
}

.app-color-Cerulean {
    color: var(--app-cerulean) !important;
}

.text-custom-light-green {
    color: #eafaf1;
}

/* ===== FORM VALIDATION ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ===== CALLOUT COMPONENTS ===== */
.callout-base {
    padding: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.25rem;
    background-color: var(--gray-100);
}

.callout-info {
    border-left: 5px solid var(--info);
}

.callout-warning {
    border-left: 5px solid var(--warning);
}

.callout-danger {
    border-left: 5px solid var(--danger);
}

.callout-success {
    border-left: 5px solid var(--success);
}

/* ===== LOADING ANIMATIONS - MODERNIZED ===== */
/* Removed 78 vendor prefixes, using modern standards */
.svg-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.stroke-still {
    stroke: #232323;
}

.stroke-animation {
    animation: stroke-spacing 1.2s ease-in, stroke-color 4.8s linear;
    animation-iteration-count: infinite;
    animation-delay: 0;
    animation-direction: normal;
    animation-fill-mode: forwards;
    animation-play-state: running;
    transform-origin: center center;
}

@keyframes stroke-spacing {
    0% {
        stroke-dasharray: 0 200;
    }
    45% {
        stroke-dashoffset: 0;
        stroke-dasharray: 200 200;
    }
    90% {
        stroke-dashoffset: -200;
        stroke-dasharray: 200 200;
    }
    100% {
        stroke-dashoffset: -200;
        stroke-dasharray: 200 200;
    }
}

@keyframes stroke-color {
    0% { stroke: #3498DB; }
    24% { stroke: #643232; }
    25% { stroke: #327864; }
    49% { stroke: #327864; }
    50% { stroke: #32326e; }
    74% { stroke: #32326e; }
    75% { stroke: #78325a; }
    99% { stroke: #78325a; }
}

/* Loading v3 - Modernized */
.loader_v3 {
    width: 10em;
    height: 10em;
    font-size: 25px;
    box-sizing: border-box;
    border-top: 0.3em solid hotpink;
    border-radius: 50%;
    position: relative;
    animation: rotating_v3 2s ease-in-out infinite;
    --direction: 1;
}

.loader_v3::before,
.loader_v3::after {
    content: '';
    position: absolute;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    box-sizing: border-box;
    top: -0.2em;
}

.loader_v3::before {
    border-top: 0.3em solid dodgerblue;
    transform: rotate(120deg);
}

.loader_v3::after {
    border-top: 0.3em solid gold;
    transform: rotate(240deg);
}

.loader_v3 span {
    position: absolute;
    color: black;
    width: inherit;
    height: inherit;
    text-align: center;
    line-height: 10em;
    font-family: sans-serif;
    animation: rotating_v3 2s linear infinite;
    --direction: -1;
}

@keyframes rotating_v3 {
    50% {
        transform: rotate(calc(180deg * var(--direction)));
    }
    100% {
        transform: rotate(calc(360deg * var(--direction)));
    }
}

/* Loading v4 - Bars animation */
.loading_v4 {
    width: 50px;
    height: 40px;
    text-align: center;
    font-size: 10px;
}

.loading_v4 > div {
    background-color: #333;
    height: 100%;
    width: 6px;
    display: inline-block;
    animation: sk-stretchdelay 1.2s infinite ease-in-out;
}

.loading_v4 .rect2 {
    animation-delay: -1.1s;
}

.loading_v4 .rect3 {
    animation-delay: -1.0s;
}

.loading_v4 .rect4 {
    animation-delay: -0.9s;
}

.loading_v4 .rect5 {
    animation-delay: -0.8s;
}

@keyframes sk-stretchdelay {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1.0);
    }
}

/* ===== ERROR UI ===== */
#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: var(--z-error-ui);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== FULLSCREEN COMPONENT ===== */
.li-wrapper {
    position: relative;
}

.li-wrapper.fullscreen {
    position: fixed !important;
    inset: 0;
    z-index: var(--z-fullscreen);
    background: var(--bs-body-bg, var(--white));
    overflow: auto;
    padding: 1rem;
    box-shadow: 0 0 0.5rem rgba(0, 0, 0, .25);
    --li-scale: 1.15;
}

.li-fs-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1070;
    background: var(--light);
    border: 1px solid var(--gray-400);
    box-shadow: 0 0 .25rem rgba(0,0,0,.15);
}

/* Scaled elements in fullscreen */
.li-wrapper.fullscreen .hiperlink,
.li-wrapper.fullscreen .student-list button,
.li-wrapper.fullscreen .custom-control-label,
.li-wrapper.fullscreen .e-badge,
.li-wrapper.fullscreen .card {
    font-size: calc(1rem * var(--li-scale));
}

.li-wrapper.fullscreen .card-body,
.li-wrapper.fullscreen .student-list button,
.li-wrapper.fullscreen .custom-control-label {
    padding: calc(.75rem * var(--li-scale));
}

/* ===== MODAL AND DIALOG FIXES ===== */
/* Fix for Bootstrap modal backdrop issues */
.modal-backdrop {
    z-index: var(--z-modal) !important;
}

.modal {
    z-index: calc(var(--z-modal) + 10) !important;
}

/* ===== DEPRECATED: SfDialog CSS Rules ===== */
/* All SfDialog components have been migrated to Bootstrap modals */
/* These rules are no longer needed but kept commented for reference */
/* Migration completed: August 2025 */

/* DEPRECATED: Syncfusion e-dlg-overlay blocking clicks issue - NO LONGER NEEDED */
/*
.e-dlg-overlay {
    pointer-events: none !important;
    background: transparent !important;
    opacity: 0 !important;
    z-index: calc(var(--z-modal) + 15) !important;
}
*/

/* DEPRECATED: Syncfusion dialogs positioning - NO LONGER NEEDED */
/*
.e-dialog {
    z-index: calc(var(--z-modal) + 20) !important;
}
*/

/* STILL NEEDED: Syncfusion dropdowns are still used in forms */
.e-popup,
.e-ddl-popup,
.e-multiselect-wrapper .e-popup {
    z-index: var(--z-dropdown-modal) !important;
}

/* Fix for modal content being clickable 
.modal-dialog {
    z-index: calc(var(--z-modal) + 25) !important;
    position: relative;
}

.modal-content {
    z-index: calc(var(--z-modal) + 30) !important;
    position: relative;
}
*/
/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, 
    .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 768px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: var(--sidebar-width);
        min-height: 100vh;
        height: auto;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
        z-index: var(--z-topbar);
    }

    .main > div {
        padding-left: 20rem !important;
        padding-right: 1.5rem !important;
        padding-top: 1.1rem;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        display: block;
    }
}