/* =====================================================
   ROOT VARIABLES (LIGHTER + MOBILE FRIENDLY)
===================================================== */
:root {
    --font-family-base: 'Noto Kufi Arabic', sans-serif;
    /* Primary Colors */
    --color-primary: #1b6ec2;
    --color-primary-dark: #155ba0;
    --color-secondary: #0071c1;
    /* Status Colors */
    --color-success: #26b050;
    --color-error: #e53935;
    --color-bg-error: #fddede;
    --color-warning: #fff4cc;
    /* Text Colors */
    --color-text-base: #333;
    --color-text-muted: #666;
    --color-text-code: #c02d76;
    /* Layout */
    --font-size-base: 15px;
    --line-height-base: 1.45;
    /* Shadows */
    --box-shadow-focus: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    /* Light Backgrounds */
    --color-bg-primary: #f5f9ff;
    --color-bg-secondary: #e6f0fa;
    --color-border: #d1e0f0;
}

/* =====================================================
   BASE GLOBAL
===================================================== */
html, body {
    font-family: 'Noto Kufi Arabic', sans-serif;
    margin: 0;
    padding: 0;
    font-size: 15px;
    color: #333;
}

h1:focus {
    outline: 2px solid #1b6ec2;
}

a, .btn-link {
    color: #0071c1;
    text-decoration: none;
}

/* =====================================================
   BUTTONS (LIGHTER + SMALLER)
===================================================== */
.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, #155ba0, #1b6ec2);
    border: 1px solid #155ba0;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: 0.25s ease;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background: linear-gradient(90deg, #1b6ec2, #155ba0);
        border-color: #1b6ec2;
        box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    }

.btn:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    outline: none;
}

/* =====================================================
   FORM VALIDATION
===================================================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e53935;
}

.validation-message {
    color: #e53935;
}

/* =====================================================
   LAYOUT
===================================================== */
.content {
    padding-top: 0.9rem;
}

/* =====================================================
   ERROR MESSAGE BAR
===================================================== */
#blazor-error-ui {
    background: #fff4cc;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.55rem 1rem;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.6rem;
        top: 0.4rem;
    }

/* =====================================================
   LOADING INDICATOR (SMALLER + SOFTER)
===================================================== */
.loading-container {
    height: 70vh;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.loading-logo {
    width: 110px;
    opacity: .85;
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: .85;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: .85;
    }
}

/* Small Dial Loading */
.loading-progress {
    position: absolute;
    width: 7rem;
    height: 7rem;
    inset: 18vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.5rem;
        transform: rotate(-90deg);
        transform-origin: 50% 50%;
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
        }

.loading-progress-text {
    position: absolute;
    inset: calc(18vh + 2.8rem) 0 auto 0.2rem;
    text-align: center;
    font-weight: bold;
    font-size: .9rem;
}

/* =====================================================
   CODE BLOCKS
===================================================== */
code {
    color: #c02d76;
}

/* =====================================================
   FLOATING PLACEHOLDERS
===================================================== */
.form-floating > .form-control::placeholder {
    color: #999;
    text-align: end;
}

.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =====================================================
   PRINT STYLES (UNCHANGED)
===================================================== */
@media print {
    body * {
        visibility: hidden !important;
    }

    .print-header, .print-header *,
    .receipt-section, .receipt-section * {
        visibility: visible !important;
    }

    .print-header {
        position: absolute;
        top: 0;
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .receipt-section {
        position: absolute;
        top: 180px;
        width: 100%;
        padding: 10px 20px;
    }

    nav, header, footer, .btn, .no-print {
        display: none !important;
    }

    table {
        width: 100%;
        font-size: 13px;
    }

    th, td {
        border: 1px solid #000 !important;
        padding: 5px;
    }
}

/* =====================================================
   DARK TABLE HEADERS
===================================================== */
.table thead.table-dark th {
    background: #334155 !important;
    color: #fff;
}

/* =====================================================
   NOTIFICATION SHAKE
===================================================== */
.notif-shake {
    animation: shake 0.7s;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-12deg);
    }

    50% {
        transform: rotate(12deg);
    }

    75% {
        transform: rotate(-12deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* =====================================================
   SCROLL TO TOP BUTTON
===================================================== */
.scroll-to-top {
    position: fixed;
    bottom: 35px;
    right: 35px;
    background: linear-gradient(135deg, #080f1c, #101a2a, #2a3b55);
    color: white;
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: 0.25s;
    z-index: 999999 !important;
}

    .scroll-to-top:hover {
        background-color: #005bb5;
    }

/* =====================================================
   MOBILE OPTIMIZATION
===================================================== */
@media (max-width: 600px) {

    body {
        font-size: 0.82rem;
    }

    .btn-primary {
        padding: 0.4rem 0.7rem;
        font-size: 0.78rem;
        border-radius: 8px;
    }

    .loading-logo {
        width: 95px;
    }

    .scroll-to-top {
        bottom: 28px;
        right: 28px;
        width: 38px;
        height: 38px;
        font-size: 1rem;
        z-index:999999 !important;
    }

    #blazor-error-ui {
        font-size: 0.8rem;
        padding: 0.45rem 0.8rem;
    }
}


.volume-popover {
    position: absolute;
    bottom: -42px;
    right: 0;
    background: #fff;
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    display: none;
    z-index: 2000;
}

.nav-item:hover .volume-popover {
    display: block;
}

.volume-popover input[type="range"] {
    width: 100px;
}