/* Global CSS */

/* ===== GLOBAL STYLES ===== */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: #555;
}

/* ===== LINKS ===== */
a, .btn-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover, .btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-light {
    background-color: var(--light-color);
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-light:hover {
    background-color: #e2e6ea;
    border-color: #cbd3da;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    padding: 0.75rem;
    transition: var(--transition);
    background-color: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid #e9ecef;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ===== TABLES ===== */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ===== BADGES ===== */
.badge {
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: #212529;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-primary {
    background-color: #cce7ff;
    border-color: #b3d9ff;
    color: #004085;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: white;
    border-right: 1px solid #e9ecef;
    min-height: 100vh;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: #e3f2fd;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 2rem;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.content-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

/* ===== UTILITIES ===== */
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.rounded-lg {
    border-radius: 12px !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .content-header {
        padding: 1.5rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ===== FOCUS STATES ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* ===== VALIDATION ===== */
.valid.modified:not([type=checkbox]) {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== BLAZOR SPECIFIC ===== */
#blazor-error-ui {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    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;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1rem 1rem 1rem 3.7rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.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);
}

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

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--primary-color);
}

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

/* ===== CODE ===== */
code {
    color: #e83e8c;
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ===== FORM FLOATING ===== */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== MATERIAL DESIGN ICONS ===== */
.material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 24px !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-feature-settings: 'liga' !important;
}

/* Ensure Radzen buttons with icons display properly */
.rz-button .material-icons {
    font-size: 18px !important;
    vertical-align: middle !important;
    margin-right: 4px !important;
    display: inline-block !important;
}

/* Small buttons */
.rz-button-sm .material-icons {
    font-size: 16px !important;
}

/* Large buttons */
.rz-button-lg .material-icons {
    font-size: 20px !important;
}

/* Fallback for when Material Icons don't load */
.rz-button[icon="add"]::before {
    content: "+" !important;
    font-weight: bold !important;
    font-size: 18px !important;
    margin-right: 4px !important;
}

.rz-button[icon="edit"]::before {
    content: "✏" !important;
    font-size: 16px !important;
    margin-right: 4px !important;
}

.rz-button[icon="delete"]::before {
    content: "🗑" !important;
    font-size: 16px !important;
    margin-right: 4px !important;
}

.rz-button[icon="save"]::before {
    content: "💾" !important;
    font-size: 16px !important;
    margin-right: 4px !important;
}

/* ===== RADZEN DIALOG STYLES ===== */
.rz-dialog {
    z-index: 1000 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.rz-dialog-mask {
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.rz-dialog-content {
    max-height: 90vh !important;
    overflow-y: auto !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    z-index: 1001 !important;
    margin: 20px !important;
    min-width: 300px !important;
    max-width: 90vw !important;
}

/* Ensure dialog is visible */
.rz-dialog-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000 !important;
}

/* Dialog header */
.rz-dialog-titlebar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 1rem 1.5rem !important;
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600 !important;
    color: #495057 !important;
}

/* Dialog body */
.rz-dialog-content-wrapper {
    padding: 1.5rem !important;
}

/* Dialog footer */
.rz-dialog-footer {
    background: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0 0 8px 8px !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
}

/* Dialog form styling */
.rz-dialog .row {
    margin-bottom: 1rem;
}

.rz-dialog .col-md-6 {
    margin-bottom: 1rem;
}

/* Notification container */
.rz-notification {
    z-index: 1001 !important;
}

/* ===== STAFF DIALOG STYLES ===== */
.staff-dialog {
    padding: 1rem;
    min-width: 600px;
}

.staff-dialog .rz-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.staff-dialog .rz-textbox,
.staff-dialog .rz-dropdown,
.staff-dialog .rz-numeric {
    margin-bottom: 1rem;
}

.staff-dialog .rz-required-validator,
.staff-dialog .rz-email-validator {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Ensure dialog buttons are properly spaced */
.staff-dialog .d-flex.justify-content-end {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.container-fluid, .row, .col-12 {
    max-width: 100vw;
    overflow-x: hidden;
}
