/**
 * Modernes CSS für Schlepperfreunde Flachsmeer
 * Responsives Design mit modernen Web-Standards
 */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #084F98;
    --secondary-color: #667eea;
    --accent-color: #764ba2;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Header & Navigation */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-container .btn {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    display: inline-block;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    min-width: 250px;
    z-index: 1000;
}

.nav-wrapper.active {
    max-height: 90vh;
    overflow-y: auto;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.nav li {
    width: 100%;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-size: 0.95rem;
    display: block;
    border-bottom: 1px solid var(--border-color);
}

.nav a:hover {
    background: rgba(8, 79, 152, 0.1);
    color: var(--primary-color);
}

.nav a.active {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.nav a.active:hover {
    background: var(--primary-color);
    color: var(--white);
    opacity: 0.9;
}


/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-light);
}

.btn-secondary:hover {
    background: #555;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem !important;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    min-height: 200px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--white);
    padding: 1rem;
    transform: translateY(100%);
    transition: var(--transition);
    cursor: pointer;
    z-index: 2;
    pointer-events: auto;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

/* Mobile: Overlay immer sichtbar */
@media (max-width: 768px) {
    .gallery-item-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.6));
    }
    
    .gallery-item img {
        cursor: pointer;
    }
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.gallery-modal-image {
    max-width: 90vw;
    max-height: calc(90vh - 200px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.gallery-modal-text {
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin-top: 1rem;
}

.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 3rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
    z-index: 10001;
}

.gallery-modal-close:hover {
    color: #ff6b6b;
    transform: scale(1.2);
}

.gallery-modal-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    width: 100%;
}

.gallery-modal-prev,
.gallery-modal-next {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10001;
    flex-shrink: 0;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--white);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .gallery-modal {
        padding: 0.5rem;
    }
    
    .gallery-modal-content {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .gallery-modal-image {
        max-width: 95vw;
        max-height: calc(100vh - 180px);
    }
    
    .gallery-modal-close {
        top: 10px;
        right: 10px;
        font-size: 2.5rem;
        width: 40px;
        height: 40px;
    }
    
    .gallery-modal-navigation {
        gap: 1.5rem;
        margin-top: 1rem;
    }
    
    .gallery-modal-prev,
    .gallery-modal-next {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .gallery-modal-text {
        font-size: 0.95rem;
        padding: 1rem 0.5rem;
        margin-top: 0.5rem;
        max-width: 95vw;
    }
}

/* Landscape orientation für Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .gallery-modal {
        padding: 0.5rem;
    }
    
    .gallery-modal-content {
        max-width: 100vw;
        max-height: 100vh;
        justify-content: flex-start;
        padding-top: 1rem;
    }
    
    .gallery-modal-image {
        max-width: 90vw;
        max-height: calc(100vh - 150px);
    }
    
    .gallery-modal-navigation {
        margin-top: 0.75rem;
        gap: 1.5rem;
    }
    
    .gallery-modal-text {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
        margin-top: 0.25rem;
        max-width: 90vw;
    }
    
    .gallery-modal-close {
        top: 5px;
        right: 5px;
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }
}

/* Video Vorschau */
.video-thumbnail-container {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.video-thumbnail-container:hover {
    transform: scale(1.02);
}

.video-thumbnail-container:hover .video-play-button {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    pointer-events: none;
    transition: var(--transition);
}

.video-play-button svg {
    margin-left: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer a {
    color: var(--white);
    text-decoration: none;
    margin: 0 1rem;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
/* Desktop: Kompakteres Menü bei mittleren Bildschirmen */
@media (max-width: 1600px) {
    .nav {
        gap: 0.4rem 0.6rem;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.45rem;
    }
}

@media (max-width: 1200px) {
    .header-container {
        padding: 1rem 1.5rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-img {
        height: 45px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .header-container {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .header-container .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        margin-right: 0.5rem;
    }
    
    .logo {
        font-size: 1.2rem;
        flex: 1;
    }
    
    .logo-img {
        height: 50px;
        max-width: 100%;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-wrapper {
        left: 0;
        right: 0;
        min-width: 100%;
    }
    
    .container {
        padding: 1rem;
        max-width: 100%;
        width: 100%;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    /* Alle Grid-Layouts auf Mobile einspaltig */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Flexbox-Layouts auf Mobile anpassen */
    div[style*="display: flex"]:not(.gallery-modal-content):not(.header-container) {
        flex-direction: column !important;
    }
    
    /* Bildverwaltung Admin */
    div[style*="grid-template-columns: 200px 1fr"],
    div[style*="grid-template-columns: 150px 1fr auto"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Hero Slider mit Schwarz-Weiß Effekt */
.hero-slider {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    margin: 0 0 2rem 0;
    overflow: hidden;
    border-radius: 0;
}

.hero-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    filter: grayscale(100%) brightness(0.7);
}

.hero-slide.active {
    opacity: 1;
    filter: grayscale(100%) brightness(0.8);
}

.hero-slide:hover {
    filter: grayscale(80%) brightness(0.9);
    transition: filter 0.5s ease;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 79, 152, 0.6) 0%, rgba(102, 126, 234, 0.5) 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 3;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.hero-indicator.active {
    background: white;
    transform: scale(1.3);
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .hero-slider {
        height: 50vh;
        min-height: 400px;
        width: 100%;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-indicators {
        bottom: 1rem;
    }
}

/* Scroll Reveal Animationen */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Galerie Reveal Animation */
.reveal-item {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-item.revealed {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Galerie Aufdecken-Effekt */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item:hover::before {
    left: 100%;
}

.gallery-item img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Card Flip Animation beim Scrollen */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.revealed {
    animation: cardFlip 0.8s ease-out;
}

@keyframes cardFlip {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateX(-10deg) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateX(0deg) translateY(0);
    }
}
