/* --- Osnovni stilovi i reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navbar --- */
.navbar {
    background-color: #fff;
    color: #333;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-item {
    margin-left: 20px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #007bff;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: #333;
}



/* --- Showcase --- */
/* --- Showcase --- */
.showcase {
    position: relative; /* Potrebno za overlay */
    color: #fff;
    height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: url('../img/showcase-pozadina.jpg') no-repeat center center/cover;
}

.showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* OVDJE PODEŠAVATE JAČINU ZATAMNJENJA */
    z-index: 1;
}

.showcase h1, .showcase p {
    position: relative;
    z-index: 2; /* Postavlja tekst iznad overlay-a */
}

.showcase h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.showcase p {
    font-size: 1.2rem;
}

/* --- Sekcije i Dugmad --- */
.latest-vehicles, .page-container {
    padding: 4rem 0;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.text-center {
    text-align: center;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background: #0056b3;
}

/* --- Vehicle Grid & Cards --- */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.vehicle-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.vehicle-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.vehicle-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.vehicle-card-content h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.vehicle-specs {
    list-style: none;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.vehicle-specs li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #555;
}

.vehicle-specs i {
    color: #333;
    width: 25px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

.vehicle-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    margin-top: auto;
    text-align: right;
}

/* --- Footer --- */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* --- Admin Panel --- */
.admin-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.admin-login {
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.admin-body { padding: 2rem 0; }
.admin-form .form-group { margin-bottom: 1rem; }
.admin-form label { display: block; margin-bottom: 5px; font-weight: bold; }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.success-message { color: green; font-weight: bold; margin-bottom: 1rem; }
.error-message { color: red; font-weight: bold; margin-bottom: 1rem; }


/* --- Responzivni dizajn --- */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 65px; /* Visina navbara */
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1.5rem 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .showcase h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 2rem;
    }
}
/* --- Stilovi za admin tabelu (dodati na kraj style.css) --- */
.admin-table-wrapper {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
.admin-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.admin-table tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}
.admin-table .actions a {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    color: #fff;
    margin-right: 5px;
    font-size: 0.9em;
}
.btn-edit { background-color: #28a745; }
.btn-edit:hover { background-color: #218838; }
.btn-delete { background-color: #dc3545; }
.btn-delete:hover { background-color: #c82333; }
/* ===============================================
   NOVI STILOVI ZA ADMIN DASHBOARD
   =============================================== */

/* --- Osnovna struktura Dashboarda --- */
.admin-dashboard-body {
    background-color: #f0f2f5; /* Svjetlija pozadina za dashboard */
    overflow-x: hidden;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 1001;
    transition: width 0.3s;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #34495e;
}
.sidebar-header h3 { margin: 0; font-size: 1.5rem; }
.sidebar-header span { font-size: 0.9rem; color: #95a5a6; }

.sidebar-nav {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav li a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 15px 25px;
    transition: background-color 0.3s, padding-left 0.3s;
}
.sidebar-nav li a:hover {
    background-color: #34495e;
    padding-left: 30px;
}
.sidebar-nav li.active a {
    background-color: #007bff;
    color: #fff;
    padding-left: 30px;
}
.sidebar-nav li i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.admin-content {
    flex-grow: 1;
    padding: 30px;
    margin-left: 250px; /* Isto kao širina sidebara */
    transition: margin-left 0.3s;
}

.content-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.content-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --- Stilovi za poruke (alerts) --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
}
.alert i { margin-right: 10px; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Stilovi za modernu formu --- */
.modern-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}
.modern-form .form-group {
    display: flex;
    flex-direction: column;
}
.modern-form .form-group.full-width {
    grid-column: 1 / -1;
}
.modern-form label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}
.modern-form input[type="text"],
.modern-form input[type="number"],
.modern-form input[type="file"],
.modern-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.modern-form input:focus, .modern-form select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-actions {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    gap: 10px;
}
.btn.btn-primary { background-color: #007bff; border: none; }
.btn.btn-primary:hover { background-color: #0056b3; }
.btn.btn-secondary { background-color: #6c757d; border: none; color: #fff; }
.btn.btn-secondary:hover { background-color: #5a6268; }

/* --- Stilovi za modernu tabelu --- */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}
.modern-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 15px;
}
.modern-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.modern-table tbody tr:hover {
    background-color: #f8f9fa;
}
.table-img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}
.modern-table .actions a {
    font-size: 1rem;
    padding: 8px 10px;
    margin: 0 3px;
    color: #fff;
    border-radius: 5px;
    display: inline-block;
}
.modern-table .actions a.btn-edit { background: #ffc107; }
.modern-table .actions a.btn-delete { background: #dc3545; }

/* --- Responzivnost za Dashboard --- */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 70px; /* Smanji sidebar na ikone */
    }
    .admin-sidebar .sidebar-header h3, .admin-sidebar .sidebar-header span { display: none; }
    .admin-sidebar .sidebar-nav li a {
        padding: 15px 0;
        text-align: center;
    }
    .admin-sidebar .sidebar-nav li a i { margin-right: 0; }
    .admin-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        align-items: center;
    }
    .sidebar-header { display: none; }
    .sidebar-nav {
        display: flex;
        justify-content: space-around;
        width: 100%;
        padding: 0;
    }
    .sidebar-nav li a { padding: 15px 5px; }
    .admin-content {
        margin-left: 0;
        padding: 20px;
    }
    .modern-form .form-grid {
        grid-template-columns: 1fr; /* Sva polja idu jedno ispod drugog */
    }
    .modern-table thead { display: none; } /* Sakrij header tabele na mobitelu */
    .modern-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .modern-table td {
        display: block;
        text-align: right;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }
    .modern-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        text-align: left;
        font-weight: bold;
    }
    .modern-table td:last-child {
        border-bottom: none;
    }
    .modern-table .actions a {
        margin: 5px 3px;
    }
}
/* Stilovi za slajder na kartici vozila */
.vehicle-slider-wrapper {
    position: relative;
    overflow: hidden;
}
.vehicle-slider {
    display: flex;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    -ms-overflow-style: none; /* IE i Edge */
    scrollbar-width: none; /* Firefox */
}
.vehicle-slider::-webkit-scrollbar { display: none; } /* Chrome, Safari, Opera */
.vehicle-slider img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.3s;
}
.vehicle-slider-wrapper:hover .slider-btn { opacity: 1; }
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

/* Stilovi za admin dio za ure??ivanje slika */
.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}
.image-to-edit { text-align: center; }
.image-to-edit img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 5px;
}
.image-to-edit label { font-size: 0.9em; cursor: pointer; }

/* Stil za broja? slika na slajderu */
.slider-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 2;
    pointer-events: none; /* Da ne ometa kliktanje na dugmad */
    display: flex;
    align-items: center;
}

.slider-counter i {
    margin-right: 6px;
    font-size: 0.8rem;
}

/* Stilovi za dno kartice (cijena i kontakt) */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Ovo gura element na dno kartice */
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.vehicle-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    text-align: right; /* Poravnaj cijenu desno */
}

.vehicle-contact {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.vehicle-contact i {
    margin-right: 8px;
    color: #007bff;
}
/* Dodavanje sjenke na tekst u showcase sekciji */
.showcase h1, .showcase p {
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
}