/*
 * Additional styles for new functionality
 */

/* Services page: white cards on tertiary background */
.services-page-section .service-card {
    background-color: white;
}

/* Service Modal Styles */
.service-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
}

.service-modal.active {
    display: block;
}

.service-modal-content {
    position: relative;
    background-color: var(--color-background);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
}

.service-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-dark-gray);
    transition: color var(--transition-fast);
}

.service-modal-close:hover {
    color: var(--color-primary);
}

.service-modal-title {
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
}

.service-modal-text {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-modal-image {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.service-modal-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Platzhalter-Layout für lange Kfz-Reparatur-Beschreibung */
.kfz-placeholder-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.kfz-placeholder-images img {
    width: 100%;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.kfz-placeholder-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.kfz-placeholder-gallery img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    margin: 2rem 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-fast);
}

.carousel-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Gallery Modal Styles — flex-Zentrierung (display:block + 100%/100% brach die Mitte gegen style.css) */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    padding: 1rem;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    width: min(96vw, 1320px);
    max-width: min(96vw, 1320px);
    height: auto;
    max-height: min(94vh, 980px);
    margin-left: auto;
    margin-right: auto;
    flex: 0 1 auto;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-modal-image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
}

/* Auf hellem Modal-Hintergrund: kräftige Blautöne statt halbtransparentem Weiß */
.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-secondary);
    color: #ffffff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
    z-index: 2010;
}

.gallery-modal-nav:hover:not(.disabled) {
    background-color: var(--color-primary);
    transform: translateY(-50%) scale(1.06);
}

.gallery-modal-nav.prev {
    left: 20px;
}

.gallery-modal-nav.next {
    right: 20px;
}

.gallery-modal-nav.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: rgba(30, 64, 175, 0.35);
    color: rgba(255, 255, 255, 0.85);
}

/* Gallery Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination-button {
    padding: 0.5rem 1rem;
    background-color: var(--color-light-gray);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-button:hover:not(:disabled),
.pagination-button.active {
    background-color: var(--color-primary);
    color: white;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Before/After Gallery Styles (Projekt-Lightbox nutzt volle Modalbreite — kein max-width 400px) */
.gallery-modal-carousel-container {
    width: 100%;
    max-width: 100%;
}

.gallery-modal-carousel {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.gallery-modal-carousel-slide {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.gallery-modal-carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-sm);
}

.image-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
}

/* Map Styles */
#map {
    height: 400px;
    width: 100%;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1;
}

/* Responsive Styles */
@media (min-width: 768px) {
    .service-modal-content {
        width: 80%;
        padding: 3rem;
    }

    .gallery-modal-carousel {
        flex-wrap: nowrap;
    }

    .gallery-modal-carousel-slide {
        width: 48%;
    }
}

/* Auto Atasever Theme Styles */
.service-icon i {
    color: var(--color-primary);
}

.service-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Filtered gallery items */
.gallery-item.filtered {
    display: none !important;
}

/* Carousel Indicators for Modal */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-indicator {
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.carousel-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicator.active {
    background-color: var(--color-primary);
    transform: scale(1.2);
}

/* Startseite: Galerie-Vorschau (echte Projekte aus gallery-projekte.json) */
#gallery .gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
}

#gallery .gallery-grid .gallery-item {
    flex: 0 1 280px;
    width: 100%;
    max-width: 320px;
    height: 300px;
    cursor: pointer;
    background-color: #ffffff;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-medium-gray);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

#gallery .gallery-grid .gallery-item .gallery-image {
    border-radius: calc(var(--border-radius-md) - 4px);
}

#gallery .gallery-grid .gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

#gallery .gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
    color: white;
    text-align: center;
    padding: 1rem;
}

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

#gallery .gallery-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

#gallery .gallery-description {
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    transition-delay: 0.1s;
}

#gallery .gallery-project-meta {
    font-size: 0.88rem;
    opacity: 0.95;
    margin: 0.35rem 0 0.5rem;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    transition-delay: 0.05s;
}

#gallery .gallery-grid .gallery-item:hover .gallery-title,
#gallery .gallery-grid .gallery-item:hover .gallery-description,
#gallery .gallery-grid .gallery-item:hover .gallery-project-meta {
    transform: translateY(0);
}

#gallery .gallery-type-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    z-index: 2;
}
