/* Main styles for Tyson Autogarage */

/* Global Styles */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #e63946;
    --accent-color: #457b9d;
    --light-color: #f1faee;
    --light-color: rgba(241, 250, 238, 0.3); /* Much more transparent light color */
    --text-color: #333333;
    --bg-color: #ffffff;
    --bg-color: rgba(255, 255, 255, 0.25); /* Very transparent white background */
    --footer-bg: #1a1a1a;
    --footer-text: #ffffff;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-light: rgba(248, 249, 250, 0.2); /* Very transparent gray light */
    --gray-medium: rgba(233, 236, 239, 0.3); /* Very transparent gray medium */
    --gray-dark: #6c757d;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    position: relative;
    z-index: 1;
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: white; /* White internal background for buttons */
}

.button.primary {
    background-color: white;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.button.primary:hover {
    background-color: var(--secondary-color);
    color: white;
}

.button.secondary {
    background-color: white;
    color: var(--text-color);
    border: 2px solid var(--secondary-color);
}

.button.secondary:hover {
    background-color: var(--secondary-color);
    color: white;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    font-weight: 700;
}

/* Language Content */
.it-content, .en-content {
    display: none;
}

/* Language switching styles */
.lang-hidden {
    display: none !important;
    visibility: hidden !important;
}

.lang-visible {
    display: block !important;
    visibility: visible !important;
}

/* Language-specific body classes for more reliable control */
body.lang-it .en-content {
    display: none !important;
    visibility: hidden !important;
}

body.lang-en .it-content {
    display: none !important;
    visibility: hidden !important;
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    .it-content, .en-content {
        transition: opacity 0.2s ease;
    }
    
    body.lang-it .en-content {
        opacity: 0;
        position: absolute;
        pointer-events: none;
    }
    
    body.lang-en .it-content {
        opacity: 0;
        position: absolute;
        pointer-events: none;
    }
    
    /* New cookie consent specific fixes for Safari */
    #cookie-consent .cookie-content {
        position: relative;
        z-index: 9998;
    }
    
    /* Make sure language switcher is above cookie banner */
    .language-selector, .mobile-language-selector {
        position: relative;
        z-index: 10000;
    }
    
    .language-selector button, .mobile-language-selector button {
        position: relative;
        z-index: 10000;
    }
    
    /* Better tap target for mobile */
    @media (max-width: 768px) {
        .language-selector button, .mobile-language-selector button {
            padding: 10px !important; /* Ensure larger tap area */
            min-width: 44px; /* Apple recommended minimum touch target size */
            min-height: 44px;
        }
    }
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--box-shadow);
}

.header .content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto; /* Prevent logo from shrinking */
}

.logo img {
    height: 65px;
    vertical-align: middle;
}

.navigation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* Allow it to size based on content */
}

.navigation ul {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping to new line */
    justify-content: center;
}

.navigation li {
    margin: 0 15px; /* Equal margin on both sides instead of just left */
    white-space: nowrap; /* Prevent text wrapping within items */
}

.navigation a {
    font-weight: 600;
    position: relative;
    padding: 5px 0; /* Add some vertical padding for better tap targets */
}

.navigation a:hover {
    color: var(--secondary-color);
}

.navigation a.active {
    color: var(--secondary-color);
}

.navigation a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
}

/* Ensure the language selector still aligns to the right */
.language-selector {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.language-selector button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: 600;
    padding: 5px 10px;
}

.language-selector button.active {
    color: var(--secondary-color);
    text-decoration: underline;
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    background-color: var(--gray-light);
    backdrop-filter: blur(6px); /* Increased blur effect */
}

.hero .content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    flex: 1;
    padding-right: 40px;
}

.hero-text h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Adding shadow to main title */
}

.hero-text p {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--gray-dark);
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
}

/* Featured Services */
.featured-services {
    padding: 80px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.services-grid.four-column {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.services-grid.four-column .service-card {
    width: 100%;
    margin-bottom: 0;
}

/* For responsive design, adjust to fewer columns on smaller screens */
@media (max-width: 1200px) {
    .services-grid.four-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid.four-column {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background-color: rgba(240, 240, 240, 0.85); /* Slightly darker background */
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-icon {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.view-all {
    text-align: center;
    margin-top: 20px;
}

/* About Preview */
.about-preview {
    padding: 80px 0;
    background-color: var(--light-color);
    backdrop-filter: blur(6px); /* Increased blur effect */
}

.about-preview .content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-image {
    flex: 1;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 25px;
}

/* Testimonials */
.testimonials {
    padding: 80px 0;
}

.testimonial-slider {
    display: flex;
    gap: 30px;
}

.testimonial-slide {
    flex: 1;
    background-color: rgba(240, 240, 240, 0.85); /* Slightly darker background */
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 30px;
}

.stars {
    color: #FFD700;
    margin-bottom: 15px;
}

.testimonial-content p {
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 15px;
    /* Remove scroll functionality */
    overflow-y: visible;
    padding-right: 0;
}

.testimonial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.google-logo {
    display: flex;
    align-items: center;
}

.google-logo img {
    height: 20px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.google-logo img:hover {
    opacity: 1;
}

.testimonial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.stars {
    color: #FFD700; /* Gold color for stars */
    font-size: 14px;
}

.testimonial-author {
    font-weight: bold;
    text-align: right;
    color: #333;
}

.testimonial-author {
    font-weight: 600;
}

/* Testimonial Styles */
.testimonial-container {
    margin: 40px 0;
}

.testimonial-slider {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.testimonial-card {
    background-color: rgba(240, 240, 240, 0.85); /* Slightly darker background */
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Darker shadow */
    transition: transform 0.3s ease;
    height: 350px; /* Increased fixed height for vertical layout */
    display: flex;
    flex-direction: column;
    width: 100%; /* Full width within grid cell */
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* Make content fill the card */
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quote-icon {
    color: #e0e0e0;
    font-size: 24px;
}

.stars {
    color: #FFD700; /* Gold color for stars */
    font-size: 14px;
}

.testimonial-content p {
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 15px;
    /* Remove scrolling and fix height */
    flex-grow: 1;
    overflow-y: hidden; 
    padding-right: 0;
    display: -webkit-box;
    -webkit-line-clamp: 8; /* Limit to approximately 8 lines */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.testimonial-author {
    font-weight: bold;
    text-align: right;
    color: #333;
    margin-top: auto; /* Push author name to bottom */
}

.testimonial-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.testimonial-prev,
.testimonial-next {
    background-color: #333;
    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 ease;
}

.testimonial-prev:hover,
.testimonial-next:hover {
    background-color: #555;
}

.testimonial-pagination {
    display: flex;
    margin: 0 15px;
}

.pagination-dot {
    width: 10px;
    height: 10px;
    background-color: #888888; /* Changed from rgba(255, 255, 255, 0.7) to dark grey */
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1); /* Optional: adding a thin border for better visibility */
}

.pagination-dot.active {
    background-color: #333333; /* Changed from white to darker grey for active dot */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* Changed shadow color to match dark theme */
}

/* Make testimonial cards more vertical on smaller screens */
@media (max-width: 768px) {
    .testimonial-slider {
        grid-template-columns: 1fr; /* Single column on small screens */
    }
    
    .testimonial-card {
        height: 320px; /* Slightly smaller on mobile */
    }
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
}

.cta-section h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.cta-section p {
    margin-bottom: 30px;
    font-size: 18px;
}

.cta-section .button.primary {
    background-color: white;
    color: var(--secondary-color);
}

.cta-section .button.primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 20px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-column p, .footer-column li {
    margin-bottom: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1.2s ease-out, visibility 1.2s;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease; /* Add smooth transition */
}

body.loaded {
    overflow: auto;
}

.intro-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.loader-logo {
    max-width: 500px; /* Increased from 350px to 500px for a bigger logo */
    animation: fadeInPulse 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8)); /* Changed from white to black shadow */
}

.loader-bar {
    width: 300px;
    height: 4px;
    background-color: #f1f1f1;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background-color: #e53935;
    border-radius: 2px;
    transition: width 0.5s ease;
}

@keyframes fadeInPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.loading-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Background Video */
.background-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -1000;
    background-size: cover;
    overflow: hidden;
    opacity: 0.2; /* Decreased opacity for darker effect */
}

/* For specific section titles - adding shadow */
.testimonials h2,
.about-preview h2,
.featured-services h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Add shadow to specific headings */
    font-weight: 700;
}

/* Increase heading visibility against background */
.featured-services h2:not(.section-title),
.about-preview h2:not(.section-title),
.testimonials h2:not(.section-title) {
    display: inline-block;
    padding: 0 15px;
    position: relative;
}

/* Optional: Add a subtle background and border to make titles stand out more */
.featured-services h2:not(.section-title)::after,
.about-preview h2:not(.section-title)::after,
.testimonials h2:not(.section-title)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.1) inset;
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-50%) translateY(100px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: auto;
}

.cookie-consent.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cookie-content {
    display: flex;
    align-items: center;
    padding: 20px;
}

.cookie-icon {
    flex: 0 0 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff0000, #c80000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    box-shadow: 0 5px 15px rgba(200, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

.cookie-icon i {
    color: white;
    font-size: 40px;
}

.cookie-text {
    flex: 1;
    color: #ffffff;
}

.cookie-text h3 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 1.4em;
}

.cookie-text p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
    opacity: 0.9;
}

.cookie-links {
    margin-top: 10px;
}

.cookie-privacy {
    color: #ff0000;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.cookie-privacy:hover {
    color: #ffffff;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 20px;
}

.cookie-buttons button {
    white-space: nowrap;
    min-width: 120px;
}

/* Animation for cookie icon */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(200, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(200, 0, 0, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(200, 0, 0, 0.3);
    }
}

/* For mobile devices */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-icon {
        margin: 0 0 15px 0;
    }
    
    .cookie-buttons {
        margin: 15px 0 0 0;
        flex-direction: row;
    }
}

/* Adding touch-specific enhancements */
.touch-device .button:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.button.clicked {
    animation: buttonPress 0.2s forwards;
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

/* Mobile menu toggle enhancement */
.mobile-menu-toggle.active {
    color: var(--secondary-color);
}

/* Ensure form elements are touch-friendly */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Make sure cookie banner content is correctly positioned for language switching */
.cookie-consent .it-content, .cookie-consent .en-content {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.lang-it .cookie-consent .it-content,
body.lang-en .cookie-consent .en-content {
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.lang-it .cookie-consent .en-content,
body.lang-en .cookie-consent .it-content {
    position: absolute !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Login Page Styles */
.login-section {
    padding: 80px 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.login-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
    outline: none;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 8px;
}

.forgot-password {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: rgba(255, 255, 255, 0.7);
}

.login-separator::before,
.login-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.login-separator::before {
    margin-right: 15px;
}

.login-separator::after {
    margin-left: 15px;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-button i {
    margin-right: 10px;
    font-size: 18px;
}

.social-button.google {
    background-color: #DB4437;
    color: white;
}

.social-button.facebook {
    background-color: #4267B2;
    color: white;
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.register-prompt {
    margin-top: 25px;
    text-align: center;
    color: white;
}

.register-prompt a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.register-prompt a:hover {
    text-decoration: underline;
}

/* Hide breadcrumbs/position indicators */
.breadcrumb,
.breadcrumbs,
.path-navigation,
.page-path,
.position-indicator,
.navigation-path {
    display: none !important;
}