/* ALLGEMEINES DESIGN & FARBEN */
:root {
    --primary-green: #009e60;
    --primary-green-hover: #007d4c;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-y: auto; /* Garantiert sichtbaren Scrollbalken */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* GRÜNES TEXT-EMOJI */
.green-soccer {
    color: var(--primary-green);
    font-size: 1.2em;
    font-weight: bold;
    display: inline-block;
    margin-right: 6px;
    vertical-align: -0.05em;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
}

.logout-btn {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: #fef2f2;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #fee2e2;
}

/* LOGIN BOX */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-box {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.login-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* UPLOAD CARD & FORM */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.upload-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-green);
}

.file-group {
    margin-bottom: 16px;
}

.file-input {
    padding: 8px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #fafafa;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-green-hover);
}

/* MELDUNGEN */
.messages {
    margin-bottom: 16px;
}

.message {
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* EVENT & GALERIE */
.event-block {
    margin-bottom: 36px;
}

.event-title {
    font-size: 1.25rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #e2e8f0;
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

/* MEDIA CARD KACHELN */
.media-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* LÖSCHEN-BUTTON OVERLAY */
.delete-form {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
}

.delete-btn {
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.1s;
}

.delete-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* TAGS UNTEN LINKS */
.media-tag {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

/* LIGHTBOX SLIDESHOW */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(15, 23, 42, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 88vh;
}

.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-media {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-counter {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 12px;
    font-weight: 500;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 25px;
    color: #ffffff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--primary-green);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.lightbox-arrow:hover {
    background: var(--primary-green);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 640px) {
    .lightbox-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}