/* ============================================
   Base Styles
   ============================================ */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#app {
    min-height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
}
.rz-layout{
    width: 100%;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

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

.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
   ============================================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
}

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

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

/* ============================================
   Authentication Layout - Responsive Container
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.auth-card-wrapper {
    width: 100%;
    max-width: 420px;
    min-width: 280px;
}

.auth-card {
    border-radius: 1rem !important;
    padding: 2rem !important;
    width: 100%;
    box-sizing: border-box;
}

.auth-content {
    width: 100%;
}

.auth-header {
    text-align: center;
    width: 100%;
}

.auth-title {
    margin-bottom: 0.25rem !important;
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
}

.auth-subtitle {
    color: var(--rz-text-secondary-color);
    font-size: clamp(0.875rem, 3vw, 1rem);
}

.auth-form-container {
    width: 100%;
}

.auth-divider {
    width: 100%;
    border: none;
    border-top: 1px solid var(--rz-border-color);
    margin: 0.5rem 0;
}

.auth-footer {
    text-align: center;
    color: var(--rz-text-tertiary-color);
}

.auth-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

/* Mobile (< 480px) */
@media (max-width: 479px) {
    .auth-container {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .auth-card-wrapper {
        max-width: 100%;
        min-width: unset;
    }
    
    .auth-card {
        padding: 1.25rem !important;
        border-radius: 0.75rem !important;
    }
    
    .auth-logo-img {
        max-height: 64px !important;
    }
    
    .auth-logo-badge {
        padding: 0.5rem !important;
    }
}

/* Small tablets (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card-wrapper {
        max-width: 380px;
    }
    
    .auth-card {
        padding: 1.5rem !important;
    }
    
    .auth-logo-img {
        max-height: 72px !important;
    }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .auth-card-wrapper {
        max-width: 400px;
    }
    
    .auth-card {
        padding: 2rem !important;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .auth-card-wrapper {
        max-width: 420px;
    }
    
    .auth-card {
        padding: 2.5rem !important;
    }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        align-items: flex-start;
        padding-top: 1rem;
        min-height: auto;
    }
    
    .auth-logo-img {
        max-height: 48px !important;
    }
    
    .auth-logo-badge {
        padding: 0.375rem !important;
    }
    
    .auth-card {
        padding: 1rem !important;
    }
}

/* ============================================
   Authentication Layout Logo Badge
   ============================================ */
.auth-logo-badge {
    display: inline-block;
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #8b5cf6 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4), 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-logo-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.5), 0 4px 12px rgba(124, 58, 237, 0.4);
}

.auth-logo-img {
    max-height: 90px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: max-height 0.2s ease;
}

/* Logo picture visibility based on Radzen theme */
.auth-logo-picture {
    display: block;
}

.auth-logo-dark {
    display: none;
}

/* Radzen dark theme support for auth logo */
.rz-dark .auth-logo-light,
:root[data-rz-theme*="dark"] .auth-logo-light {
    display: none;
}

.rz-dark .auth-logo-dark,
:root[data-rz-theme*="dark"] .auth-logo-dark {
    display: block;
}

.rz-dark .auth-logo-badge,
:root[data-rz-theme*="dark"] .auth-logo-badge {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rz-dark .auth-logo-badge:hover,
:root[data-rz-theme*="dark"] .auth-logo-badge:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.rz-dark .auth-logo-img,
:root[data-rz-theme*="dark"] .auth-logo-img {
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.1));
}

/* ============================================
   Form Floating Label Styles
   ============================================ */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

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

/* ============================================
   Custom Scrollbar Styles
   ============================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 181, 253, 0.5) rgba(196, 181, 253, 0.1);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(196, 181, 253, 0.1);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(196, 181, 253, 0.5);
    border-radius: 4px;
    transition: background 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 181, 253, 0.7);
}

/* Radzen dark theme scrollbar */
.rz-dark *,
:root[data-rz-theme*="dark"] * {
    scrollbar-color: rgba(124, 58, 237, 0.6) rgba(30, 41, 59, 0.3);
}

.rz-dark *::-webkit-scrollbar-track,
:root[data-rz-theme*="dark"] *::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
}

.rz-dark *::-webkit-scrollbar-thumb,
:root[data-rz-theme*="dark"] *::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.6);
}

.rz-dark *::-webkit-scrollbar-thumb:hover,
:root[data-rz-theme*="dark"] *::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.8);
}

.rz-form-field-label, label {
    color: var(--rz-text-color) !important;
}
.rz-layout, body, html, #app {
    background-color: transparent!important;
}

/* ============================================
   Sign In Form - Responsive Styles
   ============================================ */
.signin-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.signin-title {
    text-align: center;
    margin: 0 !important;
    font-weight: 600 !important;
}

.signin-form {
    width: 100%;
}

.signin-fields {
    width: 100%;
}

.form-field-wrapper {
    width: 100%;
}

.signin-field {
    width: 100% !important;
}

.signin-field .rz-form-field-content {
    width: 100%;
}

.signin-input {
    width: 100% !important;
}

.password-toggle-btn {
    color: var(--rz-text-color) !important;
    opacity: 0.6;
    min-width: 40px !important;
}

.password-toggle-btn:hover {
    opacity: 1;
}

.remember-me-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.remember-me-label {
    cursor: pointer;
    user-select: none;
}

.signin-submit-btn {
    width: 100% !important;
    margin-top: 0.5rem;
}

.signin-error {
    width: 100%;
    margin-top: 0.5rem;
}

.signin-links {
    text-align: center;
    width: 100%;
}

/* Mobile adjustments for signin */
@media (max-width: 479px) {
    .signin-container {
        gap: 1rem;
    }
    
    .signin-title {
        font-size: 1.125rem !important;
    }
    
    .signin-submit-btn {
        padding: 0.75rem 1rem !important;
    }
    
    .remember-me-wrapper {
        flex-wrap: wrap;
    }
}

/* Ensure form fields don't overflow */
.signin-field .rz-textbox,
.signin-field input {
    width: 100% !important;
    box-sizing: border-box;
}

/* Fix Radzen form field responsive behavior */
.auth-form-container .rz-form-field {
    width: 100% !important;
    min-width: 0 !important;
}

.auth-form-container .rz-stack {
    width: 100%;
}

/* ============================================
   First-Run Setup Form - Responsive Styles
   ============================================ */
.setup-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setup-title {
    text-align: center;
    margin: 0 !important;
    font-weight: 600 !important;
}

.setup-lede {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 0.625rem;
    background: rgba(124, 58, 237, 0.08);
    border-left: 3px solid #8b5cf6;
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.setup-lede-icon {
    color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.rz-dark .setup-lede,
:root[data-rz-theme*="dark"] .setup-lede {
    background: rgba(139, 92, 246, 0.12);
}

.setup-form {
    width: 100%;
}

.setup-fields {
    width: 100%;
}

.setup-field {
    width: 100% !important;
}

.setup-field .rz-form-field-content {
    width: 100%;
}

.setup-input {
    width: 100% !important;
}

.setup-submit-btn {
    width: 100% !important;
    margin-top: 0.5rem;
}

.setup-error {
    width: 100%;
    margin-top: 0.5rem;
}

.setup-field .rz-textbox,
.setup-field input {
    width: 100% !important;
    box-sizing: border-box;
}

/* Mobile adjustments for setup */
@media (max-width: 479px) {
    .setup-container {
        gap: 1rem;
    }

    .setup-title {
        font-size: 1.125rem !important;
    }

    .setup-lede {
        font-size: 0.8125rem;
    }

    .setup-submit-btn {
        padding: 0.75rem 1rem !important;
    }
}

/* ============================================
   Notifications Popup
   ============================================ */
.notifications-popup {
    display: none;
    position: absolute;
    overflow: hidden;
    height: 420px;
    width: 360px;
    border: var(--rz-panel-border);
    background-color: var(--rz-panel-background-color);
    box-shadow: var(--rz-panel-shadow);
    border-radius: var(--rz-border-radius);
    z-index: 1001;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
}

.notifications-popup .notifications-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rz-border-disabled-color);
    flex-shrink: 0;
}

.notifications-popup .notifications-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.notifications-popup .notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--rz-text-secondary-color);
}

.notifications-popup .notifications-empty i {
    font-size: 2.5rem;
    opacity: 0.35;
}

.notifications-popup .notification-item {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--rz-border-disabled-color);
    transition: background-color 0.15s ease;
    cursor: default;
}

.notifications-popup .notification-item:last-child {
    border-bottom: none;
}

.notifications-popup .notification-item:hover {
    background-color: var(--rz-base-background-color);
}

/* ============================================
   Scheduler slot states (global — Radzen renders
   slot elements outside Blazor CSS scope)
   ============================================ */

/* Fecha bloqueada: rayas rojas */
.slot-blocked {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(220, 38, 38, 0.06),
            rgba(220, 38, 38, 0.06) 4px,
            rgba(220, 38, 38, 0.18) 4px,
            rgba(220, 38, 38, 0.18) 8px
        ) !important;
    border-left: 3px solid rgba(220, 38, 38, 0.5) !important;
    cursor: not-allowed !important;
}

/* Día de descanso: rayas grises */
.slot-rest-day {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(100, 116, 139, 0.05),
            rgba(100, 116, 139, 0.05) 4px,
            rgba(100, 116, 139, 0.15) 4px,
            rgba(100, 116, 139, 0.15) 8px
        ) !important;
    cursor: not-allowed !important;
}

/* Fuera de turno: gris suave con borde */
.slot-outside-shift {
    background: rgba(148, 163, 184, 0.13) !important;
    border-left: 2px solid rgba(148, 163, 184, 0.35) !important;
    cursor: not-allowed !important;
}

/* Horario lleno: ámbar */
.slot-full {
    background: rgba(245, 158, 11, 0.15) !important;
    border-left: 3px solid rgba(245, 158, 11, 0.5) !important;
    cursor: not-allowed !important;
}