*,
::before,
::after {
    box-sizing: border-box;
}
body {
    background: #f0f0f0;
    font-family: "Rubik", sans-serif;
    /* Standardschrift */
    font-optical-sizing: auto;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    background-attachment: fixed; /* optional, um den Verlauf beim Scrollen fixiert zu lassen */
    background-size: cover;}

header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    border-radius: 9999px;
    width: 90%; /* Breite der Pille */
    max-width: 800px;
    background: rgba(255, 255, 255, 0.2); /* halbtransparent */
    backdrop-filter: blur(10px); /* Unschärfe für modernen Glaseffekt */
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 1000; /* Damit der Header über allem anderen steht */
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.logo {
    width:30px; height:auto;
  }

main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2rem;
    margin-top: 6rem; /* Verschiebt den Content nach unten */
}

.polaroid {
    background: #fff;
    width: 200px;
    min-height: 250px;
    margin: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    position: relative;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.03);
}

.message {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.info {
    position: absolute;
    bottom: 0.5rem;
    left: 1rem;
    font-size: 12px;
    color: #555;
}

.info .author {
    font-weight: bold;
}

/* Button zum Hinzufügen einer Nachricht */
.add-message-container {
    text-align: center;
}

.add-message-btn {
    background-color: #212121;    
    font-family: "Rubik", sans-serif;
    color: #fff;
    border: 1px solid rgb(84, 84, 84);
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-message-btn:hover {
    background-color: #555;
}

/* Overlay-Styling */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none; /* Standardmäßig ausgeblendet */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInScale 0.3s ease forwards;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.overlay-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    color: #333;
}

.overlay-content form {
    display: flex;
    flex-direction: column;
}

/* Labels etwas moderner und dezenter */
.overlay-content label {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

/* Inputs und Textarea mit modernem Look */
.overlay-content textarea,
.overlay-content input {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.95rem;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.overlay-content textarea:focus,
.overlay-content input:focus {
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.15);
}

/* Buttons etwas eleganter */
.overlay-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.save-btn, .cancel-btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #333;
    color: #fff;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.save-btn:hover, .cancel-btn:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.save-btn:active, .cancel-btn:active {
    transform: translateY(0);
}

/* Container für Herz-Icon und Like-Zahl */
.like-container {
    position: absolute;   /* Damit es unten rechts im Polaroid sitzt */
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;  /* Vertikale Ausrichtung von Icon und Zahl */
    gap: 5px;             /* Kleiner Abstand zwischen Herz und Zahl */
  }
  
  /* Herz-Icon im Standardzustand */
  .heart-icon {
    cursor: pointer;
    color: #999;          /* Herz-Umriss in grauem Farbton */
    transition: transform 0.2s ease, color 0.3s ease;
    display: inline-flex; /* Damit wir das SVG korrekt zentrieren können */
  }
  
  /* Herz-Icon beim Hover leicht vergrößern */
  .heart-icon:hover {
    transform: scale(1.2);
  }
  
  /* Gefülltes Herz: per .filled-Klasse */
  .heart-icon.filled svg path {
    fill: #e60023;    /* Herz komplett gefüllt (rot) */
    stroke: #e60023;  /* Kontur ebenfalls rot */
  }
  
  /* Standardmäßig Outline-Herz: 
     (Wenn kein .filled aktiv ist, bleibt es nur Kontur) */
  .heart-icon svg path {
    fill: none;        /* Keine Füllung */
    stroke: currentColor; 
    stroke-width: 2;
  }
  
  /* CSS für die Like-Zahl neben dem Herz */
  .like-count {
    font-size: 0.6rem;
    color: #888;
    font-weight: 400;
  }