/* CSS Variables */
:root {
    --bg-color: #f4f7f6;
    --text-color: #333;
    --card-bg: #ffffff;
    --primary-color: #d32f2f;
    --secondary-color: #2c3e50;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --border-color: #eee;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --border-radius: 15px;
    --max-width: 1400px;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f4f4f4;
    --card-bg: #1e1e1e;
    --primary-color: #ff5252;
    --secondary-color: #ffffff;
    --nav-bg: rgba(18, 18, 18, 0.95);
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all var(--transition-speed);
}

.navbar.scrolled {
    padding: 0.5rem 5%;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-speed);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-speed);
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

#language-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition-speed);
}

#language-select:hover {
    border-color: var(--primary-color);
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all var(--transition-speed);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background: var(--border-color);
    transform: rotate(15deg);
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-speed);
}

.hamburger:hover {
    background: var(--border-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80') center/cover;
    color: white;
    padding: 0 20px;
    position: relative;
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--primary-color);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Buttons */
.btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: #b71c1c;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-block;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Stats Section */
.stats {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    flex-wrap: wrap;
    gap: 20px;
    padding: 5rem 5%;
    position: relative;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-box {
    text-align: center;
    padding: 20px;
    flex: 1;
    min-width: 200px;
}

.stat-box h3 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--primary-color);
    font-weight: 800;
}

.stat-box p {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 5px;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 20px;
}

.section-title h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--secondary-color);
    font-weight: 700;
}

.section-title span {
    color: var(--primary-color);
}

/* Services Section */
.services {
    padding: 5rem 5%;
    max-width: var(--max-width);
    margin: 0 auto;
}

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

.service-card {
    background: var(--card-bg);
    padding: 0;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow-color);
    transition: all var(--transition-speed);
    border-bottom: 4px solid transparent;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom: 4px solid var(--primary-color);
    box-shadow: 0 15px 30px var(--shadow-color);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.service-card h3 {
    padding: 20px 20px 10px;
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.service-card p {
    padding: 0 20px 20px;
    color: var(--text-color);
    opacity: 0.8;
}

/* Projects Section */
.projects {
    padding: 5rem 5%;
    background: var(--card-bg);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover figcaption {
    transform: translateY(0);
}

/* Testimonials */
.testimonials {
    padding: 5rem 5%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimo-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed);
    position: relative;
}

.testimo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.testimo-card::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 20px;
    font-family: Georgia, serif;
}

.stars {
    color: #f1c40f;
    margin-bottom: 15px;
}

.testimo-card blockquote {
    margin: 0;
    position: relative;
    z-index: 1;
}

.testimo-card p {
    font-style: italic;
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.8;
}

.testimo-card cite {
    font-style: normal;
    font-weight: 600;
    color: var(--primary-color);
}

/* FAQ Section */
.faq {
    padding: 5rem 5%;
    background: var(--card-bg);
}

.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    background: var(--bg-color);
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all var(--transition-speed);
}

.accordion-item:hover {
    box-shadow: 0 4px 15px var(--shadow-color);
}

.accordion-header {
    width: 100%;
    padding: 20px;
    text-align: left;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
}

.accordion-header:hover {
    background: rgba(211, 47, 47, 0.05);
}

.accordion-header i {
    transition: transform 0.3s ease;
}

.accordion-header[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.active {
    padding-bottom: 20px;
}

.accordion-content p {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.8;
}

/* Contact Section */
.contact {
    padding: 5rem 5%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.contact-info h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.contact-info p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.contact-info a:hover {
    color: var(--primary-color);
}

.contact-info i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 20px;
}

.map-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

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

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all var(--transition-speed);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

[data-theme="dark"] .contact-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f4f4f4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* Footer */
footer {
    background: #111;
    color: white;
    padding: 3rem 5% 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: var(--max-width);
    margin: 0 auto 40px;
    text-align: left;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #aaa;
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

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

.socials a {
    color: white;
    font-size: 1.8rem;
    margin: 0 15px;
    transition: all var(--transition-speed);
    display: inline-block;
}

.socials a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid #333;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all var(--transition-speed);
    text-decoration: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background: #1ebe57;
}

/* Scroll to Top */
#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 2px 2px 10px var(--shadow-color);
    z-index: 100;
    display: none;
    transition: all var(--transition-speed);
    align-items: center;
    justify-content: center;
}

#scrollToTopBtn:hover {
    background: #b71c1c;
    transform: translateY(-3px);
}

#scrollToTopBtn.visible {
    display: flex;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 20px;
    box-shadow: 0 -5px 20px var(--shadow-color);
    z-index: 9998;
    border-top: 3px solid var(--primary-color);
}

.cookie-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    flex: 1;
    min-width: 250px;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-scroll-indicator {
        display: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .whatsapp-float,
    #scrollToTopBtn,
    .hero-scroll-indicator,
    .cookie-consent {
        display: none !important;
    }

    .hero {
        height: auto;
        padding: 40px 20px;
        background: white !important;
        color: black !important;
    }

    .hero h1,
    .hero p {
        color: black !important;
    }

    .service-card,
    .testimo-card,
    .accordion-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    a {
        text-decoration: underline;
        color: black !important;
    }

    .contact-form {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--nav-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        transition: left 0.4s ease;
        z-index: 999;
        box-shadow: 5px 0 20px var(--shadow-color);
    }

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

    .nav-links a {
        font-size: 1.2rem;
        padding: 10px 0;
    }

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

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

    .stats {
        flex-direction: column;
        gap: 30px;
    }

    .contact-container {
        padding: 20px;
    }

    .footer-content {
        text-align: center;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 5%;
    }

    .logo {
        font-size: 1.4rem;
    }

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

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .services-grid,
    .gallery,
    .testimonials-container {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ff0000;
        --text-color: #000000;
    }

    [data-theme="dark"] {
        --text-color: #ffffff;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Dark mode image handling */
[data-theme="dark"] .service-card img,
[data-theme="dark"] .gallery-item img {
    filter: brightness(0.9);
}
