/* Reset i osnovni stilovi */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Navigacija */
header {
    background-color: #1c3a56;
    padding: 0.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gallery-loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    width: 100%;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(28, 58, 86, 0.2);
    border-radius: 50%;
    border-top-color: #1c3a56;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    color: white;
    font-weight: bold;
    font-size: 1.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.logo span {
    color: #ffd700;
}

.header-contact {
    display: flex;
    margin: 0 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    color: white;
    margin-right: 1.5rem;
    white-space: nowrap;
}

.contact-item:last-child {
    margin-right: 0;
}

.contact-item svg {
    margin-right: 0.5rem;
    color: #ffd700;
}

.contact-item a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #ffd700;
}

.header-right {
    display: flex;
    align-items: center;
}

.language-toggle {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.flag-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0.3rem;
    opacity: 0.6;
    transition: all 0.3s;
    cursor: pointer;
    width: 32px;
    height: 22px;
    border-radius: 3px;
    overflow: hidden;
}

.flag-btn.active {
    opacity: 1;
    box-shadow: 0 0 0 2px white;
}

.flag-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-scrolled .mobile-menu-toggle {
    display: block;
}

.header-scrolled nav:not(.active) {
    max-height: 0;
    overflow: hidden;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 0.8rem;
}

nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

nav.active {
    max-height: 300px;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-right: 2rem;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
    display: block;
    padding: 0.5rem 0;
}

nav ul li a:hover {
    color: #ffd700;
}

@media (max-width: 992px) {
    .header-contact {
        margin: 0 1rem;
    }

    .contact-item {
        margin-right: 1rem;
    }
}

/* Heroj sekcija */
.hero {
    height: 90vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url("./images/hero-landscape.jpg") center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 4rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    max-width: 700px;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: #ffd700;
    color: #333;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #e6c200;
}

/* Glavni sadržaj */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #1c3a56;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.service-content {
    padding: 1.5rem;
}

.service-content h3 {
    margin-bottom: 1rem;
    color: #1c3a56;
}

/* Oprema sekcija */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.equipment-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.equipment-image {
    height: 250px;
    background-size: cover;
    background-position: center;
}

.equipment-content {
    padding: 1.5rem;
    text-align: center;
}

.equipment-content h3 {
    margin-bottom: 0.5rem;
    color: #1c3a56;
}

/* O nama sekcija */
.about-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.about-image {
    flex: 1;
    min-width: 300px;
    height: 400px;
    background: url("./images/excavators.avif") center/cover no-repeat;
    border-radius: 8px;
}

.about-content {
    flex: 2;
    min-width: 300px;
}

.about-content h2 {
    margin-bottom: 1.5rem;
    color: #1c3a56;
}

/* Kontakt sekcija */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-info,
.contact-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.contact-form form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    padding: 1rem;
    background-color: #1c3a56;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #15293e;
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    color: #1c3a56;
}

.contact-info p {
    margin-bottom: 1rem;
}

.contact-info i {
    margin-right: 0.5rem;
    color: #1c3a56;
}

/* Footer */
footer {
    background-color: #1c3a56;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content p {
    margin: 1rem 0;
}

.captcha-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #1c3a56;
    margin-bottom: 20px;
}

#captcha,
#captchaEn {
    width: 100px;
}

@media (min-width: 769px) {

    /* Redefinirati stilove za desktop dizajn */
    nav {
        max-height: none;
        overflow: visible;
    }

    nav ul {
        opacity: 1 !important;
        /* Važno za pregaženje dinamički dodanih stilova */
    }

    .header-scrolled nav:not(.active) {
        max-height: 0;
        overflow: hidden;
    }
}

/* Responsivnost */
@media (max-width: 768px) {
    .top-bar {
        flex-wrap: wrap;
    }

    .header-contact {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-right {
        flex: 0 0 auto;
    }

    nav ul {
        /* Uvijek koristiti column na mobilnim uređajima */
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    nav:not(.active) ul {
        display: none;
        /* Sakriti elemente kada navigacija nije aktivna */
    }

    nav.active ul {
        display: flex;
        /* Prikazati elemente samo kada je navigacija aktivna */
        padding: 1rem 0;
    }

    nav ul li {
        margin: 0.5rem 0;
        width: 100%;
    }

    nav ul li a {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

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

/* Gallery Section Styles */
.gallery-section {
    padding: 2rem 0;
}

/* Gallery Filter */
.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    padding: 0.5rem 1.2rem;
    margin: 0.3rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: #e9e9e9;
}

.filter-btn.active {
    background-color: #1c3a56;
    color: white;
    border-color: #1c3a56;
}

/* Masonry Gallery Container */
.gallery-container {
    column-count: 3;
    column-gap: 1rem;
}

/* Gallery Items */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-img {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.3s;
}

.gallery-item:hover .gallery-img {
    filter: brightness(0.8);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item-overlay h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.gallery-item-overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Lazy Loading Placeholder */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
    background-color: #f5f5f5;
}

.lazy.loaded {
    opacity: 1;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background-color: #1c3a56;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
}

.load-more-btn:hover {
    background-color: #15293e;
}

.load-more-btn.hidden {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.open {
    display: block;
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    color: white;
    cursor: pointer;
    z-index: 2100;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ffd700;
}

.modal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.modal-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    position: relative;
}

.modal-slide-container {
    flex: 1;
    text-align: center;
}

.modal-image {
    max-height: 80vh;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.modal-caption {
    margin-top: 1rem;
    color: white;
    text-align: center;
}

.modal-caption h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.modal-caption p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.slider-nav {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 0 15px;
}

.slider-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.slider-nav i {
    font-size: 1.2rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .gallery-container {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-container {
        column-count: 2;
    }

    .modal-slider {
        width: 95%;
    }

    .slider-nav {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 576px) {
    .gallery-container {
        column-count: 2;
        /* Promijenjen na 2 stupca za mobilne uređaje */
    }

    .modal-image {
        max-height: 70vh;
    }

    .slider-nav {
        width: 30px;
        height: 30px;
        margin: 0 10px;
    }
}