﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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 {
    color-scheme: light only;
    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+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNT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3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.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: #1b6ec2;
            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;
}

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

code {
    color: #c02d76;
}

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

.bb-footer {
    position: sticky;
    bottom: 0;
    width: 100%;
    background-color: var(--bs-light);
    padding: 1rem 0;
    text-align: center;
    z-index: 1000;
}

.col-one-perc {
    width: 1% !important;
}

.col-two-perc {
    width: 2% !important;
}

.col-five-perc {
    width: 5% !important;
}

td.text-center:has(> span.bb-detail-view-icon.collapsed) {
    width: 1% !important;
}

.mud-icon-root.mud-svg-icon {
    fill: #9159FF;
}

.mud-primary-header {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-on-primary);
}

    .mud-primary-header .mud-tablesort-label {
        color: var(--mud-palette-on-primary) !important;
    }

        .mud-primary-header .mud-tablesort-label .mud-icon {
            color: var(--mud-palette-on-primary) !important;
        }

/* Time Entries Table Styles */
.time-entries-table {
    font-size: 0.8rem;
}

.time-entries-table .mud-table-cell {
    padding: 2px 4px !important;
    vertical-align: middle;
}

.time-entries-table .mud-table-head .mud-table-cell {
    padding: 6px 4px !important;
    font-weight: 600;
    font-size: 0.7rem;
    white-space: nowrap;
    text-align: center;
}

/* Legend styling */
.time-entries-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--mud-palette-surface);
    border-radius: 4px;
    font-size: 0.65rem;
}

.time-entries-legend .mud-chip {
    font-size: 0.65rem !important;
    height: 20px !important;
}

/* Compact date cell */
.date-cell-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.date-cell-compact .day-short {
    font-size: 0.6rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
}

.date-cell-compact .date-short {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Full width inputs */
.time-picker-full,
.hours-input-full {
    width: 100%;
}

.time-entries-table .date-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.time-entries-table .date-cell .week-number {
    font-size: 0.6rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

.time-entries-table .date-cell .day-name {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
}

.time-entries-table .date-cell .date-value {
    font-weight: 600;
    font-size: 0.8rem;
}

.time-entries-table .notes-cell {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column helpers for editable table */
.time-entries-table .time-column {
    padding: 2px 1px !important;
}

.time-entries-table .hours-column {
    padding: 2px 1px !important;
}

.time-entries-table .date-column {
    padding: 2px 4px !important;
}

/* Compact table - even smaller */
.time-entries-table.compact .mud-table-cell {
    padding: 1px 3px !important;
    font-size: 0.75rem;
}

.time-entries-table.compact .mud-table-head .mud-table-cell {
    padding: 4px 3px !important;
    font-size: 0.65rem;
}

/* Editable table input styles */
.time-entries-table.editable .mud-input {
    font-size: 0.75rem;
}

.time-entries-table.editable .mud-input-control {
    margin: 0 !important;
}

.time-entries-table.editable .time-input {
    width: 100%;
    min-width: 70px;
}

.time-entries-table.editable .time-input .mud-input-slot {
    padding: 2px 4px !important;
    font-size: 0.75rem;
}

.time-entries-table.editable .time-input .mud-input-adornment {
    padding: 0 2px !important;
}

.time-entries-table.editable .time-input .mud-input-adornment .mud-icon-button {
    padding: 2px !important;
}

.time-entries-table.editable .hours-input {
    width: 100%;
    min-width: 30px;
}

.time-entries-table.editable .hours-input .mud-input-slot {
    padding: 2px !important;
    font-size: 0.75rem;
    text-align: center;
}

.time-entries-table.editable .hours-input input {
    text-align: center;
    padding: 2px !important;
}

/* Override MudBlazor striped/hover styles za custom row klase */
.time-entries-table.mud-table-striped .mud-table-row[class*="mud-table-row-"]:nth-of-type(odd),
.time-entries-table.mud-table-striped .mud-table-row[class*="mud-table-row-"]:nth-of-type(even) {
    background-color: inherit;
}

@media (hover: hover) and (pointer: fine) {
    .time-entries-table.mud-table-hover .mud-table-row[class*="mud-table-row-"]:hover {
        filter: brightness(0.95);
    }
}

/* Za vikende - jače označeno */
.mud-table-row-weekend-holiday {
    background-color: #e0e0e0 !important;
    border-left: 4px solid #9e9e9e !important;
}

.mud-table-row-weekend-holiday:hover {
    background-color: #d5d5d5 !important;
}

.mud-table-row-weekend-holiday .mud-table-cell {
    color: #616161;
    font-style: italic;
}

/* Za godišnji odmor - plava */
.mud-table-row-vacation {
    background-color: #e3f2fd !important;
    border-left: 4px solid #2196f3 !important;
}
.mud-table-row-vacation:hover {
    background-color: #bbdefb !important;
}

/* Za bolovanje - crvena */
.mud-table-row-sickleave {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336 !important;
}
.mud-table-row-sickleave:hover {
    background-color: #ffcdd2 !important;
}

/* Za plaćeni dopust - zelena */
.mud-table-row-paidleave {
    background-color: #e8f5e9 !important;
    border-left: 4px solid #4caf50 !important;
}
.mud-table-row-paidleave:hover {
    background-color: #c8e6c9 !important;
}

/* Za neplaćeni dopust - siva */
.mud-table-row-unpaidleave {
    background-color: #f5f5f5 !important;
    border-left: 4px solid #9e9e9e !important;
}
.mud-table-row-unpaidleave:hover {
    background-color: #eeeeee !important;
}

/* Za roditeljski/očinski dopust - ljubičasta */
.mud-table-row-parentalleave {
    background-color: #f3e5f5 !important;
    border-left: 4px solid #9c27b0 !important;
}
.mud-table-row-parentalleave:hover {
    background-color: #e1bee7 !important;
}

/* Za radno vrijeme manje od 8 sati */
.mud-table-row-under-target {
    background-color: var(--mud-palette-info-lighten); /* Koristi MudBlazor info boju */
    /* Ili fiksna boja: background-color: #2196f340; */
}

/* Za odobren status (primjer) */
.mud-table-row-approved {
    background-color: var(--mud-palette-success-lighten); /* Koristi MudBlazor success boju */
}

.mud-table-row-under-target .mud-table-cell {
    color: var(--mud-palette-info-text);
}

.mud-table-row-approved .mud-table-cell {
    color: var(--mud-palette-success-text);
}
.white-icon-btn .mud-icon-root {
    color: white !important;
}
.white-icon-btn .mud-icon-root.mud-svg-icon {
    fill: white !important;
}

/* Fix za MudIconButton Filled - ikona bijela uvijek, ne samo na hover */
.mud-icon-button.mud-button-filled.mud-button-filled-primary .mud-icon-root,
.mud-icon-button.mud-button-filled.mud-button-filled-primary .mud-icon-root.mud-svg-icon {
    color: white !important;
    fill: white !important;
}
.mud-icon-button.mud-button-filled.mud-button-filled-secondary .mud-icon-root,
.mud-icon-button.mud-button-filled.mud-button-filled-secondary .mud-icon-root.mud-svg-icon {
    color: white !important;
    fill: white !important;
}

/* Clock Loader - Initial App Load */
.clock-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.css-clock-logo {
    width: 100px;
    height: 100px;
    position: relative;
}

.clock-face {
    width: 100%;
    height: 100%;
    border: 5px solid #594ae2;
    border-radius: 50%;
    position: relative;
    background: #fff;
    box-shadow: 0 4px 20px rgba(89, 74, 226, 0.3);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: #594ae2;
    border-radius: 3px;
}

.hour-hand {
    width: 5px;
    height: 25px;
    margin-left: -2.5px;
    animation: rotate-hour 3s linear infinite;
}

.minute-hand {
    width: 4px;
    height: 35px;
    margin-left: -2px;
    animation: rotate-minute 1s linear infinite;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #594ae2;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.loader-message {
    margin-top: 1.5rem;
    color: #666;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
}

@keyframes rotate-hour {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-minute {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Notifications */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.notification-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.notification-card.unread {
    background: linear-gradient(135deg, rgba(89, 74, 226, 0.05) 0%, rgba(89, 74, 226, 0.02) 100%);
    border-left: 3px solid #594ae2;
}

.notification-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #212529;
}

.notification-message {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 0.75rem;
    color: #adb5bd;
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: #594ae2;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 8px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* TimeTrack Page - Responsive */
@media (max-width: 600px) {
    .responsive-btn-group {
        flex-direction: column !important;
        align-items: stretch !important;
        min-width: 0 !important;
    }
    .responsive-btn-group .mud-button {
        width: 100% !important;
        margin-bottom: 8px;
    }
}

/* NavMenu Custom Styles */
.custom-nav-link {
    text-transform: uppercase !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    margin: 4px 8px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
}

.custom-nav-link:hover {
    background-color: rgba(145, 89, 255, 0.1) !important;
    transform: translateX(4px) !important;
}

.custom-nav-link.mud-selected {
    background-color: rgba(145, 89, 255, 0.2) !important;
    border-left: 4px solid #9159FF !important;
}

.nav-icon {
    margin-right: 12px !important;
    color: #9159FF !important;
    font-size: 18px !important;
    min-width: 18px !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

/* MainLayout AppBar Icon */
.appbar-user-icon .mud-icon-root.mud-svg-icon {
    fill: white !important;
}

.version-text {
    font-size: 14px !important;
}

/* ClockLoader Component */
.clock-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 200px;
}

.css-clock-logo {
    width: 80px;
    height: 80px;
    position: relative;
}

.clock-face {
    width: 100%;
    height: 100%;
    border: 4px solid var(--mud-palette-primary, #594ae2);
    border-radius: 50%;
    position: relative;
    background: var(--mud-palette-surface, #fff);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: var(--mud-palette-primary, #594ae2);
    border-radius: 2px;
}

.hour-hand {
    width: 4px;
    height: 25%;
    margin-left: -2px;
    animation: rotate-hour 3s linear infinite;
}

.minute-hand {
    width: 3px;
    height: 35%;
    margin-left: -1.5px;
    animation: rotate-minute 1s linear infinite;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--mud-palette-primary, #594ae2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.loader-message {
    margin-top: 1rem;
    color: var(--mud-palette-text-secondary, #666);
    font-size: 0.9rem;
}

@keyframes rotate-hour {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-minute {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Legend popup */
.time-entries-legend-popup {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    font-size: 0.75rem;
    max-width: 400px;
    margin-top: 4px;
}

.time-entries-legend-popup .legend-section {
    margin-bottom: 8px;
}

.time-entries-legend-popup .legend-section:last-child {
    margin-bottom: 0;
}

.time-entries-legend-popup .legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.time-entries-legend-popup .legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 12px;
}

.time-entries-legend-popup .legend-colors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
}

.time-entries-legend-popup .legend-color-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-entries-legend-popup .color-box {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

.time-entries-legend-popup .color-box.weekend {
    background-color: #e0e0e0;
    border-left: 3px solid #9e9e9e;
}

.time-entries-legend-popup .color-box.vacation {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.time-entries-legend-popup .color-box.sick {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
}

.time-entries-legend-popup .color-box.paid {
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.time-entries-legend-popup .color-box.unpaid {
    background-color: #fff3e0;
    border-left: 3px solid #ff9800;
}

.time-entries-legend-popup .color-box.parental {
    background-color: #f3e5f5;
    border-left: 3px solid #9c27b0;
}

.time-entries-legend-popup .color-box.yearly-plan {
    background-color: #e0f7fa;
    border-left: 3px solid #00bcd4;
}

/* Yearly plan cell highlighting */
.yearly-plan-cell {
    background-color: rgba(0, 188, 212, 0.08) !important;
}

/* Legend header and close button */
.time-entries-legend-popup .legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1976d2;
}

.time-entries-legend-popup .legend-header-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1976d2;
}

.time-entries-legend-popup .legend-close-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.time-entries-legend-popup .legend-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Time entries table - no internal scroll */
.time-entries-table.editable .mud-table-container {
    overflow: visible !important;
}

.time-entries-table .mud-table-container {
    max-height: none !important;
    overflow: visible !important;
}