/* ============================================
   BRUTALIST TIMEWORK - Global App Styles
   ============================================ */

html, body {
    font-family: var(--font-mono);
    background-color: var(--br-concrete);
    color: var(--br-black);
}

a, .btn-link {
    color: var(--br-black);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

a:hover, .btn-link:hover {
    color: var(--br-yellow);
    text-decoration-thickness: 3px;
}

/* EXCEPTION: Sidebar navigation links must be white */
.sidebar a,
.sidebar a:link,
.sidebar a:visited,
.sidebar .nav-link,
.nav-scrollable a,
.nav-scrollable a:link,
.nav-scrollable a:visited {
    color: white !important;
    text-decoration: none !important;
}

.sidebar a:hover,
.sidebar .nav-link:hover,
.nav-scrollable a:hover {
    text-decoration: none !important;
}

/* Active sidebar links */
.sidebar a.active,
.sidebar .nav-link.active,
.nav-scrollable a.active {
    color: var(--br-black) !important;
}

/* Sub-nav links */
.sidebar .sub-nav-link,
.sidebar .sub-nav-link:link,
.sidebar .sub-nav-link:visited,
.nav-scrollable .sub-nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
}

/* === BUTTONS BRUTALIST === */
.btn-primary {
    color: var(--br-black);
    background-color: var(--br-yellow);
    border: 3px solid var(--br-black);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 var(--br-black);
}

.btn-primary:hover {
    background-color: var(--br-success);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--br-black);
}

/* === FOCUS STATES BRUTALIST === */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--br-yellow);
    outline: 3px solid var(--br-black);
    outline-offset: 2px;
}

/* === CONTENT AREA === */
.content {
    padding-top: 1.5rem;
}

h1:focus {
    outline: none;
}

/* === VALIDATION BRUTALIST === */
.valid.modified:not([type=checkbox]) {
    outline: 3px solid var(--br-success);
    outline-offset: 0;
}

.invalid {
    outline: 3px solid var(--br-error);
    outline-offset: 0;
}

.validation-message {
    color: var(--br-error);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--text-sm);
}

.validation-message::before {
    content: '[ERROR] ';
}

/* === BLAZOR ERROR BOUNDARY BRUTALIST === */
.blazor-error-boundary {
    background: var(--br-error);
    color: white;
    padding: 1rem 1rem 1rem 3.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    border-top: 4px solid var(--br-black);
    position: relative;
}

.blazor-error-boundary::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: var(--br-yellow);
    border: 3px solid var(--br-black);
}

.blazor-error-boundary::after {
    content: "[ERROR] An error has occurred.";
    font-family: var(--font-mono);
}

/* === FORM CONTROLS === */
.darker-border-checkbox.form-check-input {
    border-color: var(--br-black);
    border-width: 3px;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--br-gray-600);
    text-align: end;
    font-family: var(--font-mono);
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* === GLOBAL OVERRIDES === */
code {
    font-family: var(--font-mono);
    background: var(--br-gray-100);
    padding: 2px 6px;
    border: 2px solid var(--br-black);
    color: var(--br-error);
    font-weight: 700;
}

pre {
    background: var(--br-steel);
    color: var(--br-success);
    padding: 16px;
    border: 4px solid var(--br-black);
    overflow-x: auto;
    font-family: var(--font-mono);
}

pre code {
    background: transparent;
    border: none;
    color: var(--br-success);
    padding: 0;
}

/* === TERMINAL CURSOR GLOBAL === */
.cursor-blink::after {
    content: '█';
    animation: blink 1s infinite;
    color: var(--br-yellow);
    margin-left: 4px;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* ============================================
   SLIDE-IN PANEL (TaskDettagli)
   ============================================ */

.slide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1055;
    pointer-events: none;
}

.slide-panel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    max-width: 100vw;
    height: 100vh;
    background: var(--md-surface);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.slide-panel-open {
    right: 0;
}

.slide-panel-header {
    flex-shrink: 0;
    padding: 1.5rem;
    border-bottom: 1px solid var(--md-outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--md-surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.slide-panel-title h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-on-surface);
    margin: 0;
}

.slide-panel-close-btn {
    background: transparent;
    border: none;
    color: var(--md-on-surface-variant);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--md-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

.slide-panel-close-btn:hover {
    background: var(--md-error-container);
    color: var(--md-error);
}

.slide-panel-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .slide-panel {
        width: 100%;
        right: -100vw;
    }

    .slide-panel-open {
        right: 0;
    }

    .slide-panel-header,
    .slide-panel-body {
        padding: 1rem;
    }
}
