/**
 * Buttons - sav CSS za dugmad
 * Centralizovani stilovi za .btn, .edit-btn, .btn-action, modal dugmad, itd.
 */

/* ========== Base - tekst uvek na sredini ========== */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.btn,
a.btn,
.btn-action,
.btn-modal,
.zoom-btn,
.navbar-link,
.edit-btn {
    text-align: center;
}

button:not(.navbar-toggle),
input[type="submit"],
input[type="button"],
input[type="reset"],
.btn-action,
.btn-modal,
.edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========== .btn - osnovni stil ========== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.5;
    box-sizing: border-box;
    white-space: nowrap;
    min-width: auto;
    width: auto;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-auto {
    width: auto;
    min-width: 120px;
}

.btn-fit {
    width: fit-content;
    min-width: auto;
}

/* ========== Button Variants ========== */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.35);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.25);
}

.btn-light {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-light:hover:not(:disabled) {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-warning:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.btn-info:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-calendar {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-calendar:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.4);
}

.btn-calendar:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-group .btn {
    margin: 0;
}

/* Button with icon spacing - flex-shrink: 0 prevents icon from collapsing in flex layouts */
.btn-icon,
.btn .lucide {
    flex-shrink: 0;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon-only {
    padding: 0.75rem;
    min-width: auto;
    width: auto;
}

/* Outline variants */
.btn-outline-primary {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    box-shadow: none;
}

.btn-outline-primary:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline-secondary {
    background: transparent;
    color: #64748b;
    border: 2px solid #64748b;
    box-shadow: none;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: #64748b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    box-shadow: none;
}

.btn-outline-danger:hover:not(:disabled) {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ========== Menu link button (Otvori meni) ========== */
.btn-menu-link {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-menu-link:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* ========== Card actions wrap ========== */
.card-actions-wrap .card-actions .btn,
.owner-dashboard-cards .owner-dashboard-card-actions .btn,
.card-actions-wrap .card-actions a.btn,
.owner-dashboard-cards .owner-dashboard-card-actions a.btn {
    width: 100% !important;
    text-align: center;
}

/* ========== Navbar ========== */
.navbar-user .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

/* ========== Table action buttons ========== */
.data-table .btn-action {
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875em;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-block;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.data-table .btn-action.btn-edit {
    background: #ffc107;
    color: #000;
}

.data-table .btn-action.btn-edit:hover {
    background: #ffb300;
}

.data-table .btn-action.btn-delete {
    background: #dc3545;
    color: white;
}

.data-table .btn-action.btn-delete:hover {
    background: #c82333;
}

.data-table .btn-action.btn-view {
    background: #17a2b8;
    color: white;
}

.data-table .btn-action.btn-view:hover {
    background: #138496;
}

/* TreeTable toggle */
.data-table.treetable .treetable-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    font-size: 1.1rem;
    min-width: 32px;
    min-height: 32px;
    color: #3b82f6;
    transition: transform 0.2s ease;
}

.data-table.treetable .treetable-toggle:hover:not(:disabled) {
    color: #1d4ed8;
}

.data-table.treetable .treetable-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========== Edit modal (#editModal) ========== */
#editModal .btn-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
    box-sizing: border-box;
}

#editModal .btn-primary-modal {
    background: #3b82f6;
    color: white;
}

#editModal .btn-primary-modal:hover {
    background: #2563eb;
}

#editModal .btn-secondary-modal {
    background: #6c757d;
    color: white;
}

#editModal .btn-secondary-modal:hover {
    background: #5a6268;
}

#editModal .btn-danger-modal {
    background: #dc3545;
    color: white;
}

#editModal .btn-danger-modal:hover {
    background: #c82333;
}

/* ========== Edit page buttons (.edit-btn) ========== */
.edit-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.edit-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.edit-btn-primary:hover {
    background: #2563eb;
}

.edit-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.edit-btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.edit-btn-outline {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.edit-btn-outline:hover {
    background: #f8fafc;
    color: #475569;
}

.edit-btn-danger {
    background: #ef4444;
    color: #fff;
}

.edit-btn-danger:hover {
    background: #dc2626;
}

/* ========== Landing - Demo button ========== */
.btn-demo {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    border: none;
    animation: demo-glow 2.5s ease-in-out infinite;
}

@keyframes demo-glow {
    0%, 100% { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(16, 185, 129, 0.55); }
}

.btn-demo:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
    color: white !important;
    animation: none;
}

.btn-demo:active {
    transform: translateY(0) scale(0.97);
}
.btn-demo:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
}

/* Landing - hero guest table remove */
.hero-guest-table .btn-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

.hero-guest-table .btn-remove:hover {
    color: #b91c1c;
}

/* ========== Custom select (autocomplete) - trigger button ========== */
.custom-select-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    width: 100%;
    min-height: 44px;
    text-align: left;
    padding-right: 0.5rem;
    box-sizing: border-box;
}

/* ========== Filter tabs & actions ========== */
.filter-tabs-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tabs-buttons .btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

.filter-actions .btn,
.filter-actions a.btn,
.filter-actions button {
    min-height: 36px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (max-width: 540px) {
    .filter-tabs-buttons .btn {
        width: 100%;
        text-align: center;
    }
    .filter-actions .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ========== Licenses ========== */
.owner-licenses-actions .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

/* ========== Send document modal close ========== */
.send-document-modal-close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.9;
}

.send-document-modal-close:hover {
    opacity: 1;
}

/* ========== Responsive overrides ========== */
@media (max-width: 1052px) {
    .navbar-user .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 828px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn-group .btn {
        width: 100%;
    }
    .btn-auto,
    .btn-fit {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .navbar-user .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}
