/* ============================================
   Obračun plaća v2 - Custom CSS
   ============================================ */

/* ===== Layout ===== */
html, body {
    min-height: 100vh;
    background-color: #f5f5f5;
}

.section {
    padding-top: 1.5rem;
}

/* ===== Navbar ===== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand .navbar-item {
    font-weight: 600;
}

.navbar-dropdown {
    border-top: 2px solid #3273dc;
}

/* Desktop navbar wrap */
@media (min-width: 1024px) {
    .navbar-menu {
        display: flex;
        flex-wrap: wrap;
    }

    .navbar-start {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* ===== Cards ===== */
.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #363636;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #7a7a7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.is-primary .stat-value { color: #00d1b2; }
.stat-card.is-info .stat-value { color: #3273dc; }
.stat-card.is-success .stat-value { color: #48c774; }
.stat-card.is-warning .stat-value { color: #ffdd57; }
.stat-card.is-danger .stat-value { color: #f14668; }

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #fafafa;
    border-bottom: 2px solid #dbdbdb;
    font-weight: 600;
    white-space: nowrap;
}

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

/* Sticky action column */
.table th.is-sticky,
.table td.is-sticky {
    position: sticky;
    right: 0;
    background: white;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

.table thead th.is-sticky {
    background-color: #fafafa;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.is-info { background: #3273dc; color: white; }
.action-btn.is-success { background: #48c774; color: white; }
.action-btn.is-warning { background: #ffdd57; color: #363636; }
.action-btn.is-danger { background: #f14668; color: white; }

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header .title {
    margin-bottom: 0;
}

.page-header .controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Month Picker ===== */
.month-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-picker input[type="month"] {
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

.month-picker-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-picker-wrapper {
    position: relative;
}

.month-picker-display {
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 150px;
    text-align: center;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    transition: background 0.2s;
    display: inline-block;
}

.month-picker-display:hover {
    background: #f0f0f0;
}

.month-picker-display i {
    margin-left: 5px;
    font-size: 0.8rem;
}

.month-picker-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 1rem;
    z-index: 100;
    min-width: 260px;
    margin-top: 5px;
}

.month-picker-popup.is-active {
    display: block;
}

.month-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.month-picker-year {
    font-weight: 600;
    font-size: 1.1rem;
}

.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.month-picker-item {
    padding: 0.5rem 0.25rem;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}

.month-picker-item:hover {
    background: #f0f0f0;
}

.month-picker-item.is-selected {
    background: #00d1b2;
    color: white;
    font-weight: 600;
}

.month-picker-item.is-current {
    border: 2px solid #00d1b2;
}

/* ===== Toast Notifications ===== */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    min-width: 300px;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.toast.is-success {
    background: #48c774;
    color: white;
}

.toast.is-danger {
    background: #f14668;
    color: white;
}

.toast.is-warning {
    background: #ffdd57;
    color: #363636;
}

.toast.is-info {
    background: #3273dc;
    color: white;
}

.toast .toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.toast .toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.is-hiding {
    animation: slideOut 0.3s ease forwards;
}

/* ===== Modal Improvements ===== */
.modal-card {
    max-width: 600px;
    width: 95%;
}

.modal-card-head {
    background-color: #3273dc;
    border-bottom: none;
}

.modal-card-title {
    color: white;
}

.modal-card-head .delete {
    background-color: rgba(255,255,255,0.3);
}

.modal-card-head .delete:hover {
    background-color: rgba(255,255,255,0.5);
}

/* ===== Form Improvements ===== */
.field-group {
    background: #fafafa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.field-group-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #363636;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.is-success {
    background: #effaf3;
    color: #257942;
}

.status-badge.is-warning {
    background: #fffbeb;
    color: #947600;
}

.status-badge.is-danger {
    background: #feecf0;
    color: #cc0f35;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7a7a7a;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* ===== Money formatting ===== */
.money {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.money.is-positive { color: #48c774; }
.money.is-negative { color: #f14668; }

/* ===== Blurred Amounts (Privacy) ===== */
.blurred-amount {
    filter: blur(8px);
    user-select: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.blurred-amount.revealed {
    filter: blur(0);
}

.blurred-amount:hover {
    filter: blur(6px);
}

.blurred-amount.revealed:hover {
    filter: blur(0);
}

/* Kada je blur isključen, prikaži sve normalno */
body.blur-disabled .blurred-amount {
    filter: none;
    cursor: default;
}

body.blur-disabled .blurred-amount:hover {
    filter: none;
}

/* Blur toggle button u navbaru */
.blur-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.blur-toggle:hover {
    background-color: #f5f5f5;
}

.blur-toggle .icon {
    color: #7a7a7a;
}

.blur-toggle.is-active .icon {
    color: #3273dc;
}

/* Hint za zamućene iznose */
.blur-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 1rem;
}

.blur-hint .icon {
    font-size: 0.875rem;
}

/* Sakrij hint ako je blur isključen */
body.blur-disabled .blur-hint {
    display: none;
}

/* ===== Calendar ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 1rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.calendar-day:hover:not(.is-disabled) {
    background: #f0f0f0;
}

.calendar-day.is-selected {
    background: #00d1b2;
    color: white;
    font-weight: 600;
}

.calendar-day.is-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: #7a7a7a;
}

/* ===== Checkbox Tags (Module Selector) ===== */
.checkboxes-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-checkbox {
    cursor: pointer;
    margin: 0 !important;
}

.tag-checkbox input[type="checkbox"] {
    display: none;
}

.tag-checkbox .tag {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tag-checkbox input[type="checkbox"]:checked + .tag {
    background-color: #3273dc;
    color: white;
    border-color: #3273dc;
}

.tag-checkbox .tag:hover {
    border-color: #3273dc;
    transform: scale(1.05);
}

/* ===== Grouped Checkboxes (Module Selector) ===== */
.checkboxes-grouped {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.checkbox-category {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-category-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #7a7a7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
    padding-top: 0.25rem;
    flex-shrink: 0;
}

.checkbox-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
}

.checkbox-category-items .tag-checkbox .tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .controls {
        justify-content: space-between;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}
