/* ============================================
   Reparico.hr - Public Website CSS
   Final Version (Home + Services + Contact + Gallery)
   ============================================ */

:root {
    /* --- BOJE --- */
    --color-primary: #0056b3;       /* Glavna plava */
    --color-primary-dark: #004494;  /* Tamnija plava (hover) */
    --color-primary-light: #e3f2fd; /* Svijetla plava (pozadine) */
    
    --color-accent: #ff6b00;        /* Narančasta za akcije */
    --color-accent-hover: #e65100;
    
    --color-bg-light: #ffffff;
    --color-bg-gray: #f8f9fa;
    --color-bg-dark: #1a1a1a;
    
    --color-text-main: #333333;
    --color-text-muted: #666666;
    --color-text-light: #ffffff;
    
    --color-success: #28a745;
    --color-error: #dc3545;
    
    /* --- EFEKTI --- */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
    
    /* --- LAYOUT --- */
    --container-width: 1200px;
    --header-height: 70px;
}

/* ========== 1. RESET & BASE ========== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text-main);
    background: var(--color-bg-light);
    padding-top: var(--header-height);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }

ul { list-style: none; }

/* Typography */
h1, h2, h3, h4 { color: var(--color-primary); margin-bottom: 1rem; font-weight: 700; }
h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

@media (min-width: 992px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.5rem; }
}

/* Layout Utility */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }

/* ========== 2. COMPONENTS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
    background: var(--color-primary-light);
}

.btn-emergency {
    background: var(--color-error);
    color: #fff;
    font-weight: 700;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.btn-block { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }

/* ========== 3. HEADER & NAVIGATION ========== */

.main-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: #fff;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

.mobile-menu-toggle {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 30px; height: 21px; background: none; border: none; cursor: pointer;
}
.mobile-menu-toggle span {
    width: 100%; height: 3px; background: var(--color-primary); border-radius: 3px;
}

.nav-menu {
    display: none; position: absolute; top: var(--header-height); left: 0; right: 0;
    background: #fff; padding: 20px; box-shadow: var(--shadow-md);
    flex-direction: column; border-top: 1px solid #eee;
}
.nav-menu.active { display: flex; }
.nav-menu li { margin-bottom: 15px; }
.nav-menu a {
    color: var(--color-text-main); font-weight: 500; font-size: 1.1rem; display: block;
}
.nav-menu a.active { color: var(--color-primary); font-weight: 700; }

.header-cta { display: none; }

@media (min-width: 992px) {
    .mobile-menu-toggle { display: none; }
    .nav-menu {
        display: flex !important; position: static; flex-direction: row;
        background: transparent; box-shadow: none; border: none; padding: 0; gap: 30px;
    }
    .nav-menu li { margin: 0; }
    .nav-menu a { font-size: 1rem; }
    .header-cta {
        display: flex; align-items: center; gap: 8px; background: var(--color-bg-gray);
        padding: 8px 16px; border-radius: 50px; color: var(--color-primary); font-weight: 600;
    }
}

/* ========== 4. SHARED SECTIONS (Page Header) ========== */

.page-header {
    background: var(--color-bg-gray);
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 40px;
}
.page-header h1 { margin-bottom: 10px; }
.page-header p { color: var(--color-text-muted); font-size: 1.2rem; }

/* ========== 5. HOMEPAGE ========== */
.hero { padding: 80px 0; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); text-align: center; }
.hero-content { max-width: 800px; margin: 0 auto; }
.hero-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 30px; color: var(--color-text-muted); }
.feature-item { background: rgba(255,255,255,0.8); padding: 8px 16px; border-radius: 20px; }
.emergency-cta { background: var(--color-error); color: #fff; padding: 50px 0; text-align: center; }
.services-grid, .why-us-grid, .gallery-preview-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin: 40px 0; }
.service-card, .why-us-item { background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid #eee; transition: var(--transition); }
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.gallery-preview-item { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); position: relative; }
.gallery-preview-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.gallery-preview-item:hover img { transform: scale(1.1); }
.why-us-section { background: var(--color-bg-gray); padding: 80px 0; }
.why-us-item { text-align: center; }
.why-us-icon { font-size: 2.5rem; display: block; margin-bottom: 15px; }

/* ========== 6. SERVICES PAGE ========== */
.services-filter { margin-bottom: 40px; }
.filter-buttons { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.filter-btn { white-space: nowrap; padding: 10px 24px; border-radius: 50px; background: #fff; border: 1px solid #ddd; color: var(--color-text-muted); font-weight: 500; transition: var(--transition); display: inline-block; }
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.services-list { display: flex; flex-direction: column; gap: 30px; }
.service-card-large { background: #fff; border-radius: 12px; padding: 30px; box-shadow: var(--shadow-sm); border: 1px solid #eee; display: flex; flex-direction: column; gap: 20px; transition: var(--transition); }
.service-card-large:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.service-card-icon { width: 60px; height: 60px; background: var(--color-primary-light); color: var(--color-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; align-self: flex-start; }
.service-card-content { flex: 1; }
.service-card-details { background: var(--color-bg-gray); padding: 15px; border-radius: 6px; font-size: 0.95rem; margin-bottom: 20px; border-left: 3px solid var(--color-primary); }
.service-card-actions { display: flex; gap: 15px; flex-wrap: wrap; margin-top: auto; }

/* ========== 7. CONTACT PAGE ========== */
.contact-info-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 60px; }
.contact-info-card { background: #fff; padding: 30px 20px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-sm); border: 1px solid #eee; transition: var(--transition); display: flex; flex-direction: column; align-items: center; }
.contact-info-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.contact-info-icon { font-size: 2.5rem; margin-bottom: 15px; background: var(--color-primary-light); width: 60px; height: 60px; line-height: 60px; border-radius: 50%; }
.contact-info-link { font-size: 1.1rem; font-weight: 600; color: var(--color-text-main); }
.contact-info-badge { background: var(--color-success); color: #fff; font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; margin-top: 10px; }
.contact-content-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }

/* Form */
.contact-form-wrapper { background: #fff; padding: 30px; border-radius: 12px; box-shadow: var(--shadow-md); border: 1px solid #eee; }
.form-group { margin-bottom: 20px; }
.form-row { display: grid; gap: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
.required { color: var(--color-error); }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 1rem; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.checkbox-label input { width: 18px; height: 18px; cursor: pointer; }
.contact-map { width: 100%; height: 400px; background: #eee; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.contact-map iframe { width: 100%; height: 100%; border: 0; }
.faq-section { padding: 80px 0; background: var(--color-bg-gray); }
.faq-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.faq-item { background: #fff; padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.faq-item h3 { font-size: 1.1rem; margin-bottom: 10px; }

/* ========== 8. GALLERY PAGE (NOVO!) ========== */

.gallery-section { padding-bottom: 80px; }

/* Gallery Filter - Reusing .services-filter styles above */
.gallery-filter { margin-bottom: 40px; }

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile */
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3; /* Standard Photo Ratio */
    cursor: zoom-in;
    box-shadow: var(--shadow-sm);
    background: #000;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
    opacity: 0.9;
}

/* Hover Overlay */
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    text-align: center;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    width: 100%;
}

.gallery-item:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.gallery-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-badge {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Gallery Info (Footer text) */
.gallery-info {
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 20px;
    font-size: 0.9rem;
}

/* LIGHTBOX MODAL */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000; /* Above header */
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2010;
    transition: transform 0.2s;
}
.lightbox-close:hover { transform: scale(1.1); color: var(--color-error); }

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 2010;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-info {
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
}
.lightbox-info h3 { color: #fff; margin: 0; font-size: 1.1rem; }
.lightbox-info p { color: #ccc; margin: 5px 0 0; font-size: 0.9rem; }

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255,255,255,0.6);
    font-family: monospace;
}

/* ========== 9. MEDIA QUERIES (DESKTOP) ========== */

@media (min-width: 768px) {
    .filter-buttons { justify-content: center; flex-wrap: wrap; overflow: visible; }
    .form-row { grid-template-columns: 1fr 1fr; }
    .faq-grid { grid-template-columns: 1fr 1fr; }
    .contact-info-grid { grid-template-columns: 1fr 1fr; }
    /* Gallery Tablet */
    .gallery-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 992px) {
    /* Home 3 Cols */
    .services-grid, .why-us-grid, .gallery-preview-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    /* Gallery Page 3 Cols */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    /* Contact Info 4 Cols */
    .contact-info-grid { grid-template-columns: repeat(4, 1fr); }
    .contact-content-grid { grid-template-columns: 1.5fr 1fr; align-items: start; }
    .contact-map { height: 100%; min-height: 500px; }

    /* Service List */
    .service-card-large { flexDirection: row; alignItems: flex-start; textAlign: left; }
    .service-card-icon { width: 80px; height: 80px; fontSize: 2.5rem; flexShrink: 0; }
    

}

/* ========== 10. UTILS ========== */

/* ============================================
   FOOTER STYLES (Responzivno)
   ============================================ */

.main-footer {
    background-color: #1a1a1a; /* Tamna pozadina */
    color: #b0b0b0;            /* Svijetlo sivi tekst */
    padding: 60px 0 20px;      /* Mnogo prostora gore/dolje */
    margin-top: auto;          /* Gura footer na dno ako je stranica kratka */
    font-size: 0.95rem;
}

/* --- 1. LAYOUT ZA MOBITEL (Zadano) --- */
.footer-content {
    display: grid;
    grid-template-columns: 1fr; /* Jedan stupac (vertikalno) */
    gap: 40px;                  /* Razmak između sekcija */
    text-align: center;         /* Centriran tekst na mobitelu izgleda bolje */
}

/* Naslovi u footeru */
.footer-column h3, 
.footer-column h4 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Linkovi */
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block; /* Važno za hover efekt */
}

.footer-column a:hover {
    color: #ffffff;
    transform: translateX(5px); /* Mali pomak desno na hover */
}

/* Kontakt lista u footeru */
.footer-contact li {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrirano na mobitelu */
    gap: 10px;
}

.contact-icon {
    font-size: 1.1rem;
}

/* Social Linkovi */
.social-links {
    display: flex;
    justify-content: center; /* Centrirano na mobitelu */
    gap: 15px;
}

.social-links a {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
}

.social-links a:hover {
    background: #0056b3; /* Tvoja primarna boja */
    color: white;
    transform: translateY(-3px);
}

/* Badge za 24/7 */
.footer-badge {
    display: inline-block;
    background: #dc3545; /* Crvena boja */
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 10px;
}

/* Donji dio (Copyright) */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* --- 2. LAYOUT ZA VELIKE EKRANE (Desktop) --- */
@media (min-width: 992px) {
    .footer-content {
        grid-template-columns: 1.5fr 1fr 1fr 1fr; /* 4 Stupca: Prvi je širi */
        text-align: left; /* Vraćamo poravnanje lijevo */
        align-items: start;
    }

    /* Kontakt lista lijevo poravnata */
    .footer-contact li {
        justify-content: flex-start;
    }

    /* Social linkovi lijevo poravnati */
    .social-links {
        justify-content: flex-start;
    }
    
    /* Resetiramo hover pomak linkova da bude suptilniji */
    .footer-column a:hover {
        transform: translateX(3px);
    }
}

.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--color-primary); color: #fff;
    width: 45px; height: 45px; border-radius: 50%;
    border: none; cursor: pointer; box-shadow: var(--shadow-md);
    display: none; font-size: 1.2rem; z-index: 999;
}
.back-to-top:hover { background: var(--color-primary-dark); }
/* Stilovi za JS Alert poruke iz kontakt forme */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stil za validaciju polja (crveni obrub) */
.form-control.error {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5zM6 8.2a.5.5 0 0 1 0 1h-.2a.5.5 0 0 1 0-1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.field-error {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}