/* LOKAL Dashboard Styles */
:root {
    /* LOKAL Farbpalette basierend auf den Logos */
    --primary-green: #6B8E5A;
    --secondary-green: #8FA67C;
    --accent-brown: #B8956A;
    --light-brown: #D4C4A8;
    --dark-green: #4A6B3A;
    --background-light: #F8F6F3;
    --text-dark: #2C3E2D;
    --text-light: rgba(255, 255, 255, 0.7);
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Grundlegendes Reset und Viewport-Einstellungen */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
    background: var(--background-light);
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

/* Header */
.header {
    flex: 0 0 auto;
    min-height: 120px;
    max-height: 22vh;
    padding: 1.5vh 0;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    text-align: center;
    padding: 0 2rem;
}

.logo {
    height: 12vh;
    min-height: 100px;
    max-height: 150px;
    width: auto;
    margin-bottom: 0.8vh;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

.subtitle {
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    opacity: 0.8;
    font-weight: 300;
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh;
    overflow: hidden;
    min-height: 0;
    position: relative;
    background: transparent;
}

.main-content::before {
    content: '';
    position: absolute;
    left: -20%;
    bottom: 0;
    width: 40%;
    height: 100%;
    background-image: url('/images/LOKAL_Turm_V2.svg');
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: contain;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* Tiles Container */
.tiles-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(180px, calc(min(65vh, 18vw)), 280px)), 1fr));
    gap: clamp(0.5rem, 1vw, 1rem);
    width: 100%;
    max-width: 98vw;
    max-height: 68vh;
    margin: 0 auto;
    align-self: center;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.tiles-container.loading {
    opacity: 0.5;
}

/* Individual Tile */
.tile {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: clamp(0.4rem, 1vw, 1rem);
    box-shadow: 0 8px 30px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5%;
    border: 2px solid transparent;
    min-height: 0;
    box-sizing: border-box;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-brown));
}

.tile:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(107, 142, 90, 0.2);
    border-color: var(--primary-green);
    background: rgba(255, 255, 255, 1);
}

.tile:active {
    transform: translateY(-4px) scale(1.01);
}

.tile-image {
    width: 100%;
    height: clamp(50px, 35%, 140px);
    padding: 2%;
    border-radius: 12px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

.tile-image.no-image {
    background: linear-gradient(135deg, var(--light-brown), var(--accent-brown));
    overflow: hidden;
    padding: 0;
}

.tile-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    display: block;
    margin: auto;
}

.tile-image img[style*="aspect-ratio"] {
    border-radius: 12px;
}

.tile-image img {
    min-width: auto;
    min-height: auto;
}

.tile-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4%;
    overflow: hidden;
    padding-top: 2%;
}

.tile-title {
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    font-weight: 600;
    color: var(--primary-green);
    margin: 0;
    line-height: 1.1;
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile-description {
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: var(--text-dark);
    line-height: 1.2;
    opacity: 0.8;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Footer */
.footer {
    flex: 0 0 auto;
    min-height: 40px;
    max-height: 7vh;
    background: var(--primary-green);
    color: var(--text-light);
    padding: 0.5vh 2vw;
    font-size: clamp(0.75rem, 1vw, 1rem);
    opacity: 0.9;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 4rem);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 98vw;
    margin: 0 auto;
    gap: 1.1rem;
}

.footer-content p {
    margin: 0;
    margin-left: 55px;
}

.footer-links {
    display: flex;
    gap: 1.1rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    font-size: clamp(0.8rem, 1vw, 1rem);
}

a.admin-link {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    text-decoration: none;
    font-size: clamp(0.75rem, 0.85vw, 0.95rem);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-brown);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        min-height: 100px;
        max-height: 18vh;
    }

    .logo {
        height: 10vh;
        min-height: 80px;
        max-height: 120px;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.5rem 0;
    }
    
    a.admin-link {
        position: static;
        transform: none;
        order: -1;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .tile {
        aspect-ratio: auto;
        min-height: 200px;
    }

    /* Kleinere Schriftgrößen für Mobile */
    .footer {
        min-height: 35px;
        max-height: 6vh;
        font-size: clamp(0.7rem, 0.9vw, 0.9rem);
    }

    .footer-links a {
        font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    }

    a.admin-link {
        font-size: clamp(0.7rem, 0.8vw, 0.85rem);
    }
}

/* Animationen */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.background-tower {
    position: absolute;
    left: 20%;
    bottom: 0;
    width: 40%;
    height: 95%;
    z-index: 0;
    pointer-events: none;
}

.background-tower svg {
    width: 100%;
    height: 100%;
    transform: translateX(-80%);
}

#tower-bg {
    transform-origin: bottom left;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
}

.back-button.visible {
    display: flex;
}

.internal-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 999;
    display: none;
    flex-direction: column;
}

.internal-content.visible {
    display: flex;
}

.internal-content iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    margin-top: 4rem;
}

/* Navigation Animation */
.tiles-container {
    transition: opacity 0.3s ease;
}

.tiles-container.loading {
    opacity: 0.5;
} 