@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn[wght].woff2') format('woff2 supports variations'),
    url('../fonts/Vazirmatn[wght].woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body, html {
    font-family: var(--primary-font), serif;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

/* Global dark mode support for text elements */
p {
    color: #1f2937;
    transition: color 0.2s ease-in-out;
}

.dark p {
    color: #e5e7eb;
}

/* Global dark mode support for headings */
h1, h2, h3, h4, h5, h6 {
    color: #111827;
    transition: color 0.2s ease-in-out;
}

.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
    color: #f9fafb;
}

/* Syncfusion components */

.e-control,
[class^="e-"] *:not([class*="e-icon"]):not([class^="fa"]):not([class*="fa-"]) {
    font-family: var(--primary-font), serif !important;
}

.e-tab .e-toolbar-items .e-toolbar-item .e-tab-text {
    font-family: var(--primary-font), serif !important;
}

.e-card {
    font-family: var(--primary-font), serif !important;
}




h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
    transition: color 0.2s ease-in-out;
}

.dark a, .dark .btn-link {
    color: #60a5fa;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.dark .btn-primary {
    background-color: #2563eb;
    border-color: #1d4ed8;
}
 

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

 

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.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: rgba(255,255,255,0.25);
    color: white;
}

.sidebar .nav-item a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

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

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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;
    color: #000;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dark #blazor-error-ui {
    background: #451a03;
    color: #fef3c7;
    box-shadow: 0 -1px 2px rgba(255, 255, 255, 0.1);
}

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

.dark #blazor-error-ui .dismiss {
    color: #fef3c7;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPj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4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

/* ===== Modern Navigation Scrollbar Styles ===== */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.dark .scrollbar-thin {
    scrollbar-color: rgba(75, 85, 99, 0.5) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.5);
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(107, 114, 128, 0.7);
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(107, 114, 128, 0.7);
}

/* ===== Navigation Animation Enhancements ===== */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-in {
    animation: slideInFromTop 0.3s ease-out, fadeIn 0.3s ease-out;
}

/* ===== Nav Link Hover Glow Effect ===== */
@keyframes pulse-subtle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ===== Smooth Icon Rotation ===== */
@media (prefers-reduced-motion: no-preference) {
    .group:hover [class*="rotate-"] {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ===== Active Navigation Link Icon Styling ===== */
/* Override Syncfusion Icon colors in active navigation links */
a.active .icon-container {
    background-color: white !important;
}

.dark a.active .icon-container {
    background-color: rgb(31, 41, 55) !important; /* gray-800 */
}

/* Target both Syncfusion icons (.e-icons) and Font Awesome icons (i, [class*="fa-"]) */
/* High specificity to override Syncfusion default styles */
/* Light mode - Active state icons should be gray-700 */
li.group a.active .icon-container .e-icons,
li.group a.active .icon-container .e-icon,
li.group a.active .icon-container i,
li.group a.active .icon-container [class*="fa-"],
li.group a.active .icon-container span[class*="e-"],
a.active .icon-container .e-icons,
a.active .icon-container .e-icon,
a.active .icon-container i,
a.active .icon-container [class*="fa-"],
a.active .icon-container span[class*="e-"] {
    color: rgb(55, 65, 81) !important; /* gray-700 for light mode */
    fill: rgb(55, 65, 81) !important; /* for SVG icons */
}

/* Dark mode - Active state icons should be white */
.dark li.group a.active .icon-container .e-icons,
.dark li.group a.active .icon-container .e-icon,
.dark li.group a.active .icon-container i,
.dark li.group a.active .icon-container [class*="fa-"],
.dark li.group a.active .icon-container span[class*="e-"],
.dark a.active .icon-container .e-icons,
.dark a.active .icon-container .e-icon,
.dark a.active .icon-container i,
.dark a.active .icon-container [class*="fa-"],
.dark a.active .icon-container span[class*="e-"] {
    color: white !important; /* white for dark mode */
    fill: white !important; /* for SVG icons */
}

/* Additional targeting for Syncfusion Button component structure */
a.active .icon-container .e-btn-icon {
    color: rgb(55, 65, 81) !important;
}

.dark a.active .icon-container .e-btn-icon {
    color: white !important;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-container {
    min-height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    transition: background-color 0.2s ease-in-out;
}

.dark .loading-container {
    background-color: #111827;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
    transition: stroke 0.2s ease-in-out;
}

.dark .loading-progress circle {
    stroke: #374151;
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.dark .loading-progress circle:last-child {
    stroke: #60a5fa;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: #1f2937;
    transition: color 0.2s ease-in-out;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.dark .loading-progress-text {
    color: #f3f4f6;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}


@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: 250px;
        min-height:100vh;
        height: auto;
        min-height:100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }

    .main > div {
        transition: margin 0.3s;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}

.myAppBar {
    max-width: -webkit-fill-available;
}

 
@media print {
    body {
        visibility: hidden;
    }

    #printableDiv {
        visibility: visible;
        position: absolute;
        top: 0;
        left: 0;
    }
}

.e-bigger {
    font-size: large;
}

input[readonly] {
    cursor: not-allowed !important;
}

.fi-ku {
    background-image: url('../Svg/Flag_of_Kurd.svg');
}
 

/* PDF Dialog Styles - Production Ready */
.pdf-dialog-css .e-dlg-container {
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pdf-dialog-css .e-dlg-content {
    padding: 0 !important;
    overflow: hidden;
}

.pdf-viewer-container {
    background: #f5f5f5;
}

.pdf-loading-overlay {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(4px);
}

.pdf-loading-overlay .spinner-border {
    border-width: 0.3rem;
}

.pdf-error-overlay {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.pdf-error-overlay i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* iOS specific optimizations */
@supports (-webkit-overflow-scrolling: touch) {
    .pdf-viewer-container iframe {
        -webkit-overflow-scrolling: touch;
    }
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pdf-viewer-container iframe {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .pdf-dialog-css {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
    }
    
    .pdf-dialog-css .e-dlg-container {
        border-radius: 0;
    }
    
    .pdf-error-overlay h5 {
        font-size: 1.25rem;
    }
    
    .pdf-error-overlay p {
        font-size: 0.9rem;
    }
    
    /* Hide "Open in new tab" button on mobile */
    .pdf-dialog-css .e-footer-content .d-none {
        display: none !important;
    }
}

/* Print support */
@media print {
    .pdf-dialog-css,
    .pdf-loading-overlay,
    .pdf-error-overlay,
    .e-footer-content {
        display: none !important;
    }
}

#dotnet-compile-error {
    display: none !important;
}