:root {
    --accent: #9c27b0;
    color-scheme: dark;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', sans-serif;
    margin: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 70px;
    animation: fadeInBody 0.5s ease-in;
}

h1, h2 {
    text-align: center;
    color: var(--accent);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
    margin-bottom: 2rem;
    animation: slideUp 0.6s ease-out;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

form:hover {
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.4);
    transform: scale(1.01);
}

input[type="text"],
textarea,
input[type="file"] {
    background: #2c2c2c;
    border: 1px solid #444;
    color: #fff;
    padding: 0.6rem;
    font-size: 1rem;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

button {
    background-color: var(--accent);
    color: #fff;
    font-weight: bold;
    border: none;
    padding: 0.7rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

button:hover {
    background-color: #b04fc4;
}

.entry {
    border-top: 1px solid #333;
    padding-top: 1rem;
    margin-bottom: 1.2rem;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInEntry 0.5s ease forwards;
    animation-delay: 0.1s;
    font-size: 0.94rem;
    line-height: 1.45;
    background-color: #181818;
    border-radius: 6px;
    padding: 1rem;
}

.entry-layout {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem; /* Ensure proper spacing before like/comment sections */
}

.entry-text {
    flex: 1;
}

.thumbnail-link {
    flex-shrink: 0;
}

.thumbnail-link img {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #555;
}

.entry-text p {
    margin: 0 0 0.3rem;
    font-size: 0.96rem;
    font-weight: 600;
    color: #ddd;
}

.entry-text > div {
    font-size: 0.94rem;
    color: #bbb;
}

@media(min-width: 600px) {
    .entry-layout {
        flex-direction: row;
        gap: 1rem;
        align-items: flex-start; /* Align items to top */
    }

    .thumbnail-link {
        max-width: 150px;
        flex-shrink: 0;
    }

    .thumbnail-link img {
        max-width: 150px;
        max-height: 150px;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
        border: 1px solid #555;
    }
}


#image-preview-container {
    margin-top: -0.5rem;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
    display: none;
}

#image-preview-container.show {
    opacity: 1;
    transform: scale(1);
    display: block;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* Like Button */
.like-area {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.like-icon {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.like-icon span {
    display: inline-block;
    transition: transform 0.2s ease;
}

.like-icon:disabled {
    opacity: 0.5;
    cursor: default;
}

.like-count {
    font-size: 1.1rem;
    color: #ccc;
}

/* Instagram Footer */
.insta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    background: #1e1e1e;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insta-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(156, 39, 176, 0.4);
}

.insta-icon {
    height: 24px;
    width: 24px;
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1e1e1e;
    padding: 0.8rem 1rem;
    text-align: center;
    z-index: 999;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.6);
    border-top: 1px solid #333;
}
.carousel-container {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 2rem;
    height: 500px; /* Fixe Höhe für konsistente Darstellung */
}

.carousel-slide {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.6s ease-in-out;
}

.carousel-slide.active {
    display: block;
}

/* Geblurrter Hintergrund */
.carousel-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transform: scale(1.1); /* verhindert Ränder beim Blur */
    z-index: 1;
}

/* Vordergrundbild */
.carousel-slide img {
    position: relative;
    z-index: 2;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
}

.carousel-slide img {
    cursor: zoom-in;
}

/* Beschriftung */
.carousel-caption {
    position: absolute;
    z-index: 3;
    bottom: 10%;
    left: 5%;
    background: rgba(18, 18, 18, 0.9);
    padding: 1rem;
    border-radius: 6px;
    color: #fff;
    max-width: 80%;
}

.carousel-caption h3 {
    margin: 0 0 0.5rem;
    color: var(--accent);
}

/* Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 4;
    padding: 0.5rem 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.2);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}


/* Kommentare */
.comments {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #bbb;
    border-left: 2px solid var(--accent);
    padding-left: 0.8rem;
    clear: both; /* Ensure comments appear below any floated content */
}

.comments h4 {
    margin-bottom: 0.3rem;
    font-size: 1rem;
    color: var(--accent);
}

.comments > div {
    margin-bottom: 0.6rem;
}

.comment-form {
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

.comment-form input,
.comment-form textarea {
    font-size: 0.9rem;
    padding: 0.4rem;
}

.comment-form.hidden {
    display: none;
}

.comments img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 0.5rem;
    display: block;
}

.toggle-comment-btn {
    margin-top: 0.5rem;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.toggle-comment-btn:hover {
    background-color: rgba(156, 39, 176, 0.2);
}

/* Animationen */

@keyframes fadeInBody {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
