/* =========================================
   1. VARIABLEN & DARK MODE
   ========================================= */
:root {
    /* Light Mode (Standard) */
    --bg-color: #F2F2F7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text: #000000;
    --primary: #007AFF;   /* iOS Blau */
    --danger: #FF3B30;    /* iOS Rot */
    --border: #E5E5EA;
    --input-bg: #FFFFFF;
}

body.dark-mode {
    /* Dark Mode Farben */
    --bg-color: #000000;
    --card-bg: rgba(28, 28, 30, 0.85);
    --text: #FFFFFF;
    --border: #38383A;
    --input-bg: #1C1C1E;
}

/* =========================================
   2. BASIS STYLES
   ========================================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    margin: 0;
    padding: 0;
    /* Sanfter Wechsel zwischen Dark/Light Mode */
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Verhindert horizontales Scrollen auf Handys */
    overflow-x: hidden;
}

h1, h2, h3 { font-weight: 700; margin-top: 0; }

/* =========================================
   3. iOS CARD DESIGN (Container)
   ========================================= */
.ios-card {
    background: var(--card-bg);
    /* Der typische "Milchglas"-Effekt */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin: 40px auto; /* Abstand von oben */
    max-width: 400px;  /* Handy-Breite optimiert */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

/* Dark Mode Switcher (Icon oben rechts) */
.mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
}

/* =========================================
   4. FORMULARE & BUTTONS
   ========================================= */
.form-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    box-sizing: border-box;
    font-size: 16px; /* Verhindert Zoom auf iPhones */
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary);
}

.btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: opacity 0.2s;
}

.btn:active { opacity: 0.8; transform: scale(0.98); }

.btn-primary { background-color: var(--primary); color: white; }
.btn-danger { 
    background-color: transparent; 
    color: var(--danger); 
    border: 1px solid var(--danger);
}

/* Nachrichten (Erfolg/Fehler) */
.msg-success { color: #34C759; }
.msg-error { color: #FF3B30; }

/* =========================================
   5. KAMERA UPLOAD BUTTON
   ========================================= */
/* Das echte Input Feld verstecken */
#cameraInput { display: none; }

/* Der große Button */
.camera-btn-label {
    display: block;
    width: 90px;
    height: 90px;
    margin: 20px auto;
    background: var(--primary);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.camera-btn-label:active { transform: scale(0.9); }

/* Das Kamera-Icon im Button */
.camera-btn-label::after {
    content: '📷';
    font-size: 45px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

/* =========================================
   6. USER GALERIE (Gitteransicht)
   ========================================= */
.my-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Bilder nebeneinander */
    gap: 8px;
    margin-top: 25px;
}

.my-gallery-item {
    position: relative;
    aspect-ratio: 1 / 1; /* Quadratisch */
    overflow: hidden;
    border-radius: 8px;
}

.my-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Kleiner Lösch-Button am Bild */
.my-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    text-decoration: none;
    text-align: center;
    line-height: 20px; /* Zentriert das x vertikal */
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* =========================================
   7. WALL / SLIDESHOW (Beamer Ansicht)
   ========================================= */
#slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black; /* Wichtig für die Ränder */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
}

#current-image {
    /* WICHTIG: contain sorgt dafür, dass das ganze Bild sichtbar ist */
    width: 100%;
    height: 100%;
    object-fit: contain; 
    
    /* Animation */
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

#current-image.active {
    opacity: 1;
}

/* Name des Fotografen Overlay */
.photo-credit {
    position: absolute;
    bottom: 50px;
    left: 50px;
    background: rgba(255, 255, 255, 0.15); /* Sehr transparent */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 12px 25px;
    border-radius: 50px; /* Pillen-Form */
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    z-index: 10;
}

.photo-credit.active {
    opacity: 1;
    transform: translateY(0);
}

.photo-credit::before {
    content: '📸 ';
    margin-right: 10px;
}

/* =========================================
   8. WALL 2 (POLAROID STREAM)
   ========================================= */
/* Hintergrund für Wall 2 */
body.wall2-bg {
    background: radial-gradient(circle at center, #2b2b2b 0%, #000000 100%);
    overflow: hidden;
    margin: 0;
}

/* Der Polaroid Container */
.polaroid {
    position: absolute;
    background: #fff;
    padding: 15px 15px 55px 15px; /* Unten mehr Platz für Text */
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    width: 280px; /* Feste Breite für den Look */
    transform-origin: center;
    will-change: transform, top;
    z-index: 1;
    
    /* Startposition (unterhalb des Bildschirms) */
    top: 110%; 
}

/* Das Bild im Polaroid */
.polaroid img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Quadratisch zuschneiden sieht am besten aus */
    object-fit: cover;
    background: #eee;
    display: block;
}

/* Der Name (Schreibmaschinen-Look) */
.polaroid-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', Courier, monospace; /* Schreibmaschine */
    font-weight: bold;
    color: #333;
    font-size: 1.2rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Die Flug-Animation */
@keyframes floatUp {
    0% {
        top: 110%;
        opacity: 0;
        transform: rotate(var(--rot-start)) scale(0.8);
    }
    10% {
        opacity: 1;
    }
    100% {
        top: -600px; /* Weit oben rausfliegen */
        transform: rotate(var(--rot-end)) scale(1);
    }
}