@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --navy: #1a2238;
    --navy-dark: #0b0e14;
    --cyan: #38b2ac;
    --cyan-hover: #319795;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text: #2d3748;
    --text-muted: #718096;
    --danger: #ff4d4d;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* --- Layout --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px;
}
main { flex: 1 0 auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
header {
    background-color: var(--navy);
    padding: 15px 0;
    position: fixed;
    top: 0; width: 100%; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--cyan); text-decoration: none; }
.logo span { color: var(--white); }
nav ul { display: flex; gap: 20px; list-style: none; align-items: center; }
nav a { color: var(--white); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
nav a:hover { color: var(--cyan); }

/* --- Hero & Suche --- */
.section-hero { background: var(--navy); color: white; text-align: center; padding: 60px 20px; }

.search-container {
    max-width: 600px;
    margin: 25px auto;
    position: relative;
    display: flex;
    gap: 10px;
}
.search-input {
    flex: 1;
    padding: 12px 25px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    outline: none;
}
.search-input:focus { box-shadow: 0 0 0 3px rgba(56, 178, 172, 0.4); }

.scope-toggle { margin-bottom: 25px; display: flex; justify-content: center; gap: 0; }
.scope-toggle .btn:first-child { border-radius: 25px 0 0 25px; min-width: 140px; }
.scope-toggle .btn:last-child { border-radius: 0 25px 25px 0; min-width: 140px; }

.action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    transition: 0.3s;
    cursor: pointer;
}
.btn-cyan { background: var(--cyan); color: white; }
.btn-cyan:hover { background: var(--cyan-hover); transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--cyan); color: var(--cyan); background: transparent; }
.btn-outline:hover { background: var(--cyan); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-back { text-decoration: none; color: var(--cyan); font-weight: 600; }

/* --- Sortierung --- */
.sort-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid var(--cyan);
    background: transparent;
    color: var(--cyan);
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.sort-select option { background: var(--navy); color: white; }

/* --- Galerie Grid & Cards --- */
.section-white { background: white; padding: 60px 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }

.card {
    background: var(--white);
    border-radius: 20px;
    transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 20px;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.media-preview {
    width: 100%; height: 180px;
    background: var(--navy-dark);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}
.media-preview img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.card-title { font-size: 1.1rem; margin: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; text-align: left; }
.card-actions { display: flex; gap: 10px; }
.flex-grow { flex: 1; }
.icon-only { padding: 10px 15px; }

.toggle-btn { background: none; border: none; cursor: pointer; }
.icon-cyan { color: var(--cyan); font-size: 1.2rem; }
.icon-muted { color: #ccc; font-size: 1.2rem; }

/* --- Footer --- */
.simple-footer { flex-shrink: 0; background-color: var(--navy); color: #a0aec0; padding: 40px 0; text-align: center; }
.footer-legal a { color: #a0aec0; text-decoration: none; margin: 0 15px; font-size: 0.85rem; }
.footer-copy { font-size: 0.75rem; opacity: 0.6; margin-top: 15px; }

.empty-state { grid-column: 1 / -1; padding: 60px; text-align: center; color: var(--text-muted); }

/* --- Detail-Ansicht --- */
.viewer-main { background: #0b0e14; border-radius: 15px; display: flex; align-items: center; justify-content: center; min-height: 500px; padding: 20px; }
.main-media { max-width: 100%; max-height: 75vh; object-fit: contain; }

@media (max-width: 768px) {
    .action-bar { flex-direction: column; }
    .search-container { flex-direction: column; }
    .search-btn { width: 100%; }
}

/* Macht den Logout-Button zum optischen Link */
.btn-nav {
    background: none;
    border: none;
    color: var(--white) !important; /* Erzwingt Weiß wie bei den Links */
    font-family: inherit;
    font-size: 0.9rem; /* Gleiche Größe wie nav a */
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: 0.3s;
    display: inline;
}

.btn-nav:hover {
    color: var(--cyan) !important; /* Cyan beim Drüberfahren */
}

/* Entfernt den blauen Unterstrich, den manche Browser bei Buttons in Formularen erzwingen */
form[action*="logout"] {
    display: inline;
}

.item-checkbox {
    accent-color: var(--cyan);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Wenn eine Karte ausgewählt ist, kriegt sie einen Rahmen */
.card:has(.item-checkbox:checked) {
    border: 2px solid var(--cyan);
    background: #f0fdfa; /* Sehr helles Cyan */
}