:root {
    /* Apple Light Mode Palette & Glass */
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --primary-color: #0071e3;
    /* Apple Blue */
    --primary-hover: #0077ED;
    --permanent-color: #a259ff;
    --danger-color: #ff3b30;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* Automatischer Dark Mode je nach System */
@media (prefers-color-scheme: dark) {
    :root {
        /* Apple Dark Mode Palette & Glass */
        --bg-gradient: linear-gradient(135deg, #151516 0%, #29292a 100%);
        --glass-bg: rgba(40, 40, 40, 0.5);
        --glass-border: rgba(255, 255, 255, 0.08);
        --text-main: #f5f5f7;
        --text-muted: #a1a1a6;
        --primary-color: #2997ff;
        --primary-hover: #3ea6ff;
        --permanent-color: #bf5af2;
        --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    }
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    /* Apple System Fonts */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    max-width: 1200px;
    /* Breiter für das Grid */
    margin: auto;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    color: var(--text-main);
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* NEU: Kompaktes Kachel-Grid für die Wünsche */
#wishes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

#admin-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* --- Glassmorphism UI (Milchglas-Effekt) --- */
.wish-card,
.iban-box,
form {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Für Safari */
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

/* Card Styling für das Grid */
.wish-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 140px;
}

.wish-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px 0 rgba(0, 0, 0, 0.15);
}

.wish-image-container {
    width: 130px;
    min-width: 130px;
    background-color: rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-right: 1px solid var(--glass-border);
}

.wish-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.wish-info {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 6px;
    justify-content: center;
}

@media (max-width: 500px) {
    #wishes-container {
        grid-template-columns: 1fr;
    }
    .wish-card {
        flex-direction: column;
    }
    .wish-image-container {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
}

.wish-list-badge {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    align-self: flex-start;
    margin-bottom: 4px;
}

.wish-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.wish-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wish-shop {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.wish-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    width: fit-content;
    text-align: center;
    margin-top: 8px;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: scale(0.96);
}

.btn-permanent {
    background-color: var(--permanent-color);
}

.btn-danger {
    background-color: var(--danger-color);
}

.iban-box {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

form {
    padding: 25px;
    margin-bottom: 30px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0 16px 0;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.4);
}

@media (prefers-color-scheme: dark) {

    input,
    textarea,
    select {
        background: rgba(0, 0, 0, 0.2);
    }

    input:focus,
    textarea:focus,
    select:focus {
        background: rgba(0, 0, 0, 0.4);
    }
}

.fulfilled {
    opacity: 0.5;
    filter: grayscale(100%);
}

.admin-list-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 500px;
    overflow-y: auto;
}

details.admin-details {
    margin-bottom: 20px;
}

details.admin-details summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
    width: auto;
}

details.admin-details summary::-webkit-details-marker {
    display: none;
}

.details-content {
    margin-top: 15px;
}