/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Color Palette based on ProRačun Logo */
:root {
    --color-dark-blue: #1e3a5f;
    --color-blue-900: #1e40af;
    --color-light-grey: #cbd5e1;
    --color-dark-grey: #374151;
    --color-charcoal: #1f2937;
}

/* Body and Typography */
body {
    scroll-behavior: smooth;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Navigation Styles */
#navbar {
    transition: box-shadow 0.3s ease;
}

#navbar.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Smooth scroll offset for fixed navigation */
section {
    scroll-margin-top: 80px;
}

/* Accordion Animations */
.faq-answer,
.service-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

.faq-answer:not(.hidden),
.service-content:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
}

.faq-question svg,
.service-accordion-btn svg {
    transition: transform 0.3s ease;
}

.faq-question svg.rotate-180,
.service-accordion-btn svg.rotate-180 {
    transform: rotate(180deg);
}

/* Button Hover Effects */
a[href^="tel:"],
a[href^="mailto:"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a[href^="tel"]:hover,
a[href^="mailto:"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Card Hover Effects */
.bg-gray-50:hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-gray-50:hover {
    transform: translateY(-4px);
}

/* Custom Scrollbar (optional, for better UX) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-dark-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-blue-900);
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--color-blue-900);
    outline-offset: 2px;
}

/* Loading State for Images */
img {
    transition: opacity 0.3s ease;
}

img[onerror] {
    opacity: 0.7;
}

/* Responsive Typography Adjustments */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    #navbar,
    #mobileMenuBtn,
    #langToggle,
    #langToggleMobile {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}

/* Additional Utility Classes */
.text-balance {
    text-wrap: balance;
}

/* Ensure proper spacing for sections */
section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Google Maps iframe styling */
iframe {
    border-radius: 0.5rem;
}

/* Ensure logo displays properly */
img[alt="ProRačun Logo"] {
    object-fit: contain;
    height: 3rem;
    width: 3rem;
}

/* Mobile menu animation */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent text selection on buttons (optional) */
button {
    user-select: none;
}

/* Ensure proper contrast for accessibility */
.text-gray-700 {
    color: #374151;
}

.text-gray-600 {
    color: #4b5563;
}

/* Link styles */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Ensure smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, transform, box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Hero Section Background */
.hero-section {
    position: relative;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero-section {
        min-height: 800px;
    }
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://images.unsplash.com/photo-1554224155-6726b3ff858f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2011&q=80');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 1;
    z-index: 1;
}

/* Alternative: Use local image if available */
/* .hero-background {
    background-image: url('assets/images/hero-background.jpg');
} */

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(239, 246, 255, 0.8) 100%);
    z-index: 2;
}

/* Fade-in Animation for Hero Content */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    will-change: opacity, transform;
}

/* Hero text styling for better readability */
.hero-section .container {
    width: 100%;
}

.hero-section .fade-in-up {
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.hero-section h1 {
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9);
    color: #1e3a5f;
}

.hero-section p {
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
    color: #374151;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade-in Section Animations - Optimized for performance */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Contact Form Styles */
#contactForm {
    transition: box-shadow 0.3s ease;
}

#contactForm:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

#contactForm input,
#contactForm textarea {
    transition: all 0.3s ease;
}

#contactForm input:focus,
#contactForm textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.1), 0 2px 4px -1px rgba(30, 64, 175, 0.06);
}

#contactForm label {
    color: #1e3a5f;
}

#contactForm button[type="submit"] {
    transition: all 0.3s ease;
}

#contactForm button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.3), 0 4px 6px -2px rgba(30, 64, 175, 0.2);
}

#contactForm button[type="submit"]:active {
    transform: translateY(0);
}

#formMessage {
    animation: slideDown 0.3s ease-out;
}

