/* ==========================================================================
   SHARED COMPONENTS
   Ovaj fajl sadrži stilove za komponente koje se koriste i na javnom delu
   sajta i u admin/user panelima (dugmad, alerti, forme, tabele...).
   ========================================================================== */

/* --- Definicija deljenih varijabli --- */
:root {
    /* Boje za stanja (Alerts, Statuses) */
    --success-text: #155724;
    --success-bg: #d4edda;
    --success-border: #c3e6cb;

    --danger-text: #721c24;
    --danger-bg: #f8d7da;
    --danger-border: #f5c6cb;

    --info-text: #0c5460;
    --info-bg: #d1ecf1;
    --info-border: #bee5eb;

    --warning-text: #856404;
    --warning-bg: #fff3cd;
    --warning-border: #ffeeba;

    /* Boje za labele statusa */
    --status-approved-text: #065f46;
    --status-approved-bg: #d1fae5;
    --status-pending-text: #92400e;
    --status-pending-bg: #fef3c7;
    --status-suspended-text: #991b1b;
    --status-suspended-bg: #fee2e2;
    --status-rejected-text: #4b5563;
    --status-rejected-bg: #e5e7eb;

    /* Ostale boje */
    --secondary-color: #6c757d;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #28a745;
    --placeholder-color: #adb5bd;
}

/* --- Buttons & Alerts --- */
.btn {
    display: inline-block; padding: 0.625rem 1.25rem; font-size: 1rem; font-weight: 600;
    text-align: center; cursor: pointer; border: 1px solid transparent;
    border-radius: 0.25rem; transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    background-color: var(--primary-color); color: #fff;
    text-decoration: none; /* Osigurava da <a> tagovi stilizovani kao dugmad nemaju podvučen tekst */
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.btn-secondary { background-color: var(--secondary-color); border-color: var(--secondary-color); color: #fff; }
.btn-info { background-color: var(--info-text); color: #fff; }
.btn-danger { background-color: var(--danger-color); color: #fff; }
.btn-warning { background-color: var(--warning-color); color: #fff; }
.btn-success { background-color: var(--success-color); color: #fff; }

.alert { padding: 0.9375rem; margin-bottom: 1.25rem; border: 1px solid transparent; border-radius: 0.25rem; }
.alert-success { color: var(--success-text); background-color: var(--success-bg); border-color: var(--success-border); }
.alert-danger { color: var(--danger-text); background-color: var(--danger-bg); border-color: var(--danger-border); }
.alert-info { color: var(--info-text); background-color: var(--info-bg); border-color: var(--info-border); }

/* --- Status Labels --- */
.status-label {
    padding: 0.25rem 0.625rem;
    border-radius: 0.9375rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.0313rem;
    display: inline-block; /* Osigurava pravilno ponašanje */
}
.status-label.status-approved, .status-label.status-active { background-color: var(--status-approved-bg); color: var(--status-approved-text); }
.status-label.status-pending { background-color: var(--status-pending-bg); color: var(--status-pending-text); }
.status-label.status-suspended, .status-label.status-expired { background-color: var(--status-suspended-bg); color: var(--status-suspended-text); }
.status-label.status-rejected { background-color: var(--status-rejected-bg); color: var(--status-rejected-text); }


/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
/* Pojednostavljen selektor sa :is() za bolju čitljivost */
.form-group :is(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="file"], input[type="url"], input[type="tel"], input[type="date"], textarea, select) { 
    width: 100%; padding: 0.75rem 0.9375rem;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: var(--text-color, #34495e);
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.25rem;
}
.form-group :is(input, textarea, select):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}
.form-group small { display: block; margin-top: 0.3125rem; color: var(--secondary-color); font-size: 0.9em; }
input::placeholder, textarea::placeholder { color: var(--placeholder-color) !important; opacity: 1; }

/* Form-specific additions */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.address-finder { margin-bottom: 0.625rem; }
.amenities-container {
    border: 1px solid #dee2e6; padding: 1.25rem; margin-top: 0.625rem; border-radius: 0.25rem;
}
.amenity-group { margin-bottom: 1.5625rem; }
.amenity-group:last-child { margin-bottom: 0; }
.amenity-group h4 {
    margin-top: 0; margin-bottom: 0.9375rem; border-bottom: 1px solid #eee;
    padding-bottom: 0.625rem; font-size: 1.1em; color: #34495e;
}
.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9375rem; }
.amenity-item { display: flex; align-items: center; }
.amenity-item input[type="checkbox"] { margin-right: 0.625rem; }
.amenity-item label { display: flex; align-items: center; gap: 0.5rem; }

.form-divider {
    text-align: center; margin: 1.5625rem 0; color: #888;
    display: flex; align-items: center; gap: 0.9375rem;
}
.form-divider hr { flex-grow: 1; border: none; border-top: 1px solid #eee; }
.form-divider span { font-weight: 600; }

.social-login-buttons { text-align: center; }
.form-switch-link {
    text-align: center; margin-top: 1.5625rem; padding-top: 1.25rem; border-top: 1px solid #eee;
}
.form-footer-links { text-align: center; margin-top: 0.9375rem; }

/* Character counter for textareas */
#char-counter {
    text-align: right; font-size: 0.85em; color: var(--secondary-color); margin-top: 0.3125rem;
}
#char-counter.limit-exceeded { color: var(--danger-color); }

/* --- Image Management --- */
.responsive-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.9375rem; margin-top: 0.625rem; padding: 0.625rem; background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 0.25rem; }
.image-grid-item, .preview-item { position: relative; aspect-ratio: 4 / 3; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 0.25rem; }
.image-grid-item img, .preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Grupisanje identičnih selektora */
.btn-delete-thumb, .btn-remove-preview { position: absolute; top: 0.3125rem; right: 0.3125rem; background-color: rgba(231, 76, 60, 0.8); color: white; border: none; border-radius: 50%; width: 1.5rem; height: 1.5rem; font-size: 1rem; font-weight: bold; line-height: 1.5rem; text-align: center; cursor: pointer; transition: background-color 0.2s; padding: 0; }
.btn-delete-thumb:hover, .btn-remove-preview:hover { background-color: #c0392b; }

/* --- Tables (preimenovano iz .admin-table) --- */
.data-table-wrapper {
    overflow-x: auto;
    width: 100%;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.25rem;
}
.data-table th, .data-table td {
    padding: 0.75rem 0.9375rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    white-space: nowrap;
}
.data-table th { background-color: #f8f9fa; font-weight: 600; }
.data-table tbody tr:hover { background-color: #f1f5f9; }
.data-table .action-buttons, .data-table .credit-form {
    display: flex; gap: 0.5rem; align-items: center; flex-wrap: nowrap;
}
.data-table .credit-form input[type="number"] { width: 65px; padding: 0.375rem 0.5rem; }
.data-table .actions-cell { white-space: nowrap; }

/* --- Pagination --- */
.pagination-container {
    margin-top: 1.5625rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}
.pagination .page-link, .pagination .page-link-ellipsis {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    border: 1px solid #ddd;
    background-color: #fff;
    color: var(--text-color, #34495e);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}
.pagination .page-link:hover { background-color: #f1f5f9; border-color: #ccc; }
.pagination .page-link.active { background-color: var(--sidebar-active-bg, #34495e); color: var(--sidebar-active-text, #fff); border-color: var(--sidebar-active-bg, #34495e); cursor: default; }
.pagination .page-link-ellipsis { border: none; background: none; }

/* --- Utility klase --- */
.text-center { text-align: center; }
.py-50 { padding-top: 3.125rem; padding-bottom: 3.125rem; }
.mb-20 { margin-bottom: 1.25rem; }
.my-10 { margin-top: 0.625rem; margin-bottom: 0.625rem; }

/* --- Specifične komponente --- */
.booking-com-note {
    font-size: 0.8rem; color: #6c757d; text-align: center; margin-top: 8px; padding: 0 10px;
}
.sidebar-ad-slot {
    margin-top: 1.25rem; padding: 0.9375rem; background: #f9f9f9; text-align: center; border-radius: 0.25rem;
}
.sidebar-ad-slot h4 {
    margin-top: 0; margin-bottom: 0.9375rem; font-size: 0.9em; color: #7f8c8d; text-transform: uppercase;
}
.badge.badge-bump { background-color: var(--success-color); color: white; font-weight: 600; }

/* Stil za istaknuti bedž na kartici oglasa */
.badge.badge-featured {
    background-color: #ffc107; /* Zlatno-žuta boja */
    color: #333; /* Tamniji tekst za bolji kontrast */
    border: 1px solid #ffc107;
}

/* Sakrij strelicu za padajući meni na mobilnim uređajima */
@media (max-width: 991px) {
    .user-menu-toggle .dropdown-arrow {
        display: none;
    }
}

/* --- Modal za potvrdu brisanja --- */
.delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Sakriven po defaultu, JS ga prikazuje */
    justify-content: center;
    align-items: center;
    z-index: 1050;
}
.delete-modal-overlay.is-active {
    display: flex;
}
.delete-modal-content {
    background: var(--white-color, #fff);
    padding: 1.875rem; /* 30px */
    border-radius: 0.25rem; /* 4px */
    width: 90%;
    max-width: 31.25rem; /* 500px */
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: background-color 0.4s ease;
}
.delete-modal-close {
    position: absolute;
    top: 0.625rem; /* 10px */
    right: 1rem; /* 15px */
    font-size: 2rem;
    font-weight: 300;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
}
.delete-modal-content h3 { margin-top: 0; margin-bottom: 1rem; color: var(--danger-color, #dc3545); }
.modal-error-message { color: var(--danger-text); background-color: var(--danger-bg); border: 1px solid var(--danger-border); padding: 0.625rem; border-radius: 0.25rem; margin-top: 0.625rem; font-size: 0.9rem; }
.modal-actions {
    margin-top: 1.25rem; /* 20px */
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem; /* 10px */
}

/* Stilovi za "Zapamti me" checkbox */
.form-group-checkbox {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
}
.form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}
.form-group-checkbox label { margin-bottom: 0; font-weight: 400; }
