
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #fff7fa;
    color: #80566a;
    min-height: 100vh;
}

.gallery-header {
    background: linear-gradient(135deg, #ffe2ed, #f4dafa);
    padding: 30px 7%;
    text-align: center;
    position: relative;
}

.back-link {
    position: absolute;
    top: 30px;
    left: 7%;
    color: #a75f82;
    text-decoration: none;
    font-weight: 600;
}

.eyebrow {
    color: #bd7796;
    letter-spacing: 4px;
    font-size: 11px;
    margin-bottom: 12px;
}

h1 {
    color: #a65e82;
    font-size: clamp(30px, 5vw, 46px);
    margin-bottom: 8px;
}

.subtitle {
    color: #98758a;
}

.logout-button {
    position: absolute;
    top: 25px;
    right: 7%;
    border: 1px solid #d99ab6;
    background: white;
    color: #a65e82;
    border-radius: 20px;
    padding: 9px 18px;
    cursor: pointer;
}

.gallery-container {
    width: 90%;
    max-width: 1100px;
    margin: 45px auto;
}

.upload-card {
    background: white;
    border: 1px solid #f3dce6;
    border-radius: 20px;
    padding: 28px;
    max-width: 600px;
    margin: 0 auto 55px;
    box-shadow: 0 10px 30px rgba(160, 90, 120, 0.07);
}

    .upload-card h2,
    .section-heading h2 {
        color: #a65e82;
        margin-bottom: 8px;
    }

    .upload-card > p,
    .section-heading p {
        color: #a68a99;
        font-size: 14px;
        margin-bottom: 22px;
    }

form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 16px 0 8px;
}

form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #efd2df;
    border-radius: 10px;
    background: #fffafd;
    color: #80566a;
}

form button {
    width: 100%;
    margin-top: 22px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, #e88bb1, #c879a1);
    font-weight: bold;
    cursor: pointer;
}

    form button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

#uploadMessage {
    margin-top: 12px;
    font-size: 13px;
}

.section-heading {
    text-align: center;
    margin-bottom: 25px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.memory-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(160, 90, 120, 0.08);
}

    .memory-card img {
        display: block;
        width: 100%;
        height: 250px;
        object-fit: cover;
    }

.memory-details {
    padding: 17px;
}

    .memory-details h3 {
        color: #a65e82;
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .memory-details p {
        font-size: 12px;
        color: #a68a99;
        margin-top: 7px;
    }

.delete-button {
    margin-top: 14px;
    border: 1px solid #edc4d5;
    color: #b45e82;
    background: white;
    border-radius: 8px;
    padding: 8px 13px;
    cursor: pointer;
}

.empty-message {
    text-align: center;
    padding: 35px;
    color: #a68a99;
    grid-column: 1 / -1;
}

footer {
    text-align: center;
    padding: 30px;
    color: #b28b9e;
    font-size: 13px;
}

@media (max-width: 600px) {
    .gallery-header {
        padding: 85px 20px 30px;
    }

    .back-link {
        top: 22px;
        left: 20px;
    }

    .logout-button {
        top: 17px;
        right: 20px;
    }

    .gallery-container {
        width: 92%;
        margin-top: 30px;
    }

    .upload-card {
        padding: 22px;
    }
}

/* FULL-SCREEN MEMORY VIEWER */

.memory-card img {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

    .memory-card img:hover {
        transform: scale(1.03);
    }

.memory-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(35, 20, 30, 0.94);
    align-items: center;
    justify-content: center;
    padding: 60px 70px;
}

    .memory-viewer.active {
        display: flex;
    }

.viewer-content {
    max-width: 900px;
    width: 100%;
    max-height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .viewer-content img {
        max-width: 100%;
        max-height: 72vh;
        object-fit: contain;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

.viewer-caption {
    margin-top: 20px;
    color: white;
}

    .viewer-caption h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .viewer-caption p {
        color: #e7cbd8;
        font-size: 14px;
    }

.close-viewer {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 42px;
    cursor: pointer;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 20px;
    cursor: pointer;
}

    .viewer-nav:hover {
        background: rgba(255, 255, 255, 0.35);
    }

    .viewer-nav.previous {
        left: 20px;
    }

    .viewer-nav.next {
        right: 20px;
    }

body.viewer-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .memory-viewer {
        padding: 65px 45px;
    }

    .viewer-content img {
        max-height: 65vh;
    }

    .viewer-nav {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

        .viewer-nav.previous {
            left: 5px;
        }

        .viewer-nav.next {
            right: 5px;
        }

    .close-viewer {
        top: 10px;
        right: 15px;
    }
}
