:root {
    --primary-color: #9b5de5;
    /* Lilac / Amethyst */
    --primary-light: #f1e4ff;
    /* Soft Lilac */
    --dark-text: #3c2a4d;
    /* Deep plum for text */
    --light-text: #ffffff;
    --bg-color-1: #ffffff;
    /* White */
    --bg-color-2: #f8f4ff;
    /* Very slight lilac white */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2));
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1.5" fill="%239b5de5" fill-opacity="0.1"/></svg>');
    opacity: 0.8;
    z-index: -1;
}

.floating-petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile optimal max width */
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
}

.hero-image-stack {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 280px;
    /* Base height to give it volume */
    margin: 0 auto 1.5rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hero-image-stack .card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(155, 93, 229, 0.35);
    border: 3px solid var(--primary-light);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-image-stack .card-1 {
    z-index: 5;
    transform: rotate(-2deg);
    opacity: 1;
}

.hero-image-stack .card-2 {
    z-index: 4;
    transform: rotate(4deg) translate(12px, 12px) scale(0.95);
    opacity: 0.9;
}

.hero-image-stack .card-3 {
    z-index: 3;
    transform: rotate(-4deg) translate(-10px, 22px) scale(0.9);
    opacity: 0.75;
}

.hero-image-stack .card-4 {
    z-index: 2;
    transform: rotate(6deg) translate(15px, 30px) scale(0.85);
    opacity: 0.6;
}

.hero-image-stack .card-5 {
    z-index: 1;
    transform: rotate(-5deg) translate(-12px, 35px) scale(0.8);
    opacity: 0.4;
}

.hero .subtitle {
    font-size: 0.95rem;
    margin-top: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6a5a4b;
}

/* Views Handle */
.view {
    display: none;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

/* Glass Card styling (for all cards) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* Login View Specials */
.icon-heart {
    font-size: 2.5rem;
    color: var(--primary-color);
    display: inline-block;
    margin-bottom: 0.5rem;
    animation: heartbeat 2s infinite;
}

.glass-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.glass-card p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    margin-bottom: 1.2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid #dcdcdc;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.2);
}

/* Buttons */
.btn-primary {
    width: 100%;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(155, 93, 229, 0.4);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 93, 229, 0.6);
    background-color: #8348c6;
}

.btn-primary.btn-large {
    padding: 1.2rem;
    font-size: 1.1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--dark-text);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: underline;
    font-family: var(--font-body);
}

.btn-secondary {
    width: 100%;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: var(--primary-light);
}

/* Upload View */
.greeting-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
}

.upload-icon-wrapper i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.hidden-input {
    display: none;
}

/* Progress */
.upload-progress-container {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.upload-item {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.upload-item-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
}

.upload-item-info {
    flex: 1;
    min-width: 0;
}

.upload-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.status-icon {
    font-size: 1.2rem;
    color: #999;
}

.status-icon.success {
    color: #27ae60;
}

.status-icon.error {
    color: #e74c3c;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 93, 229, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(155, 93, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(155, 93, 229, 0);
    }
}

/* Gallery styles */
.gallery-card {
    padding: 1.5rem;
}

.gallery-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1.5rem;
}

@media (min-width: 380px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: #eaeaea;
    cursor: pointer;
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-img-wrapper:hover img {
    transform: scale(1.05);
}

.loading-gallery {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 0;
    color: #666;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-content {
    max-width: 95%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    margin-top: 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: center;
}

.lightbox-caption span {
    color: var(--primary-light);
    font-weight: 600;
}

/* Guestbook Messages Style */
.messages-list {
    margin-top: 1rem;
    max-height: 280px;
    overflow-y: auto;
    text-align: left;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.message-bubble h4 {
    margin-bottom: 4px;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.message-bubble p {
    font-size: 0.88rem;
    color: var(--dark-text);
    margin-bottom: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
    border-top: 1px dashed rgba(155, 93, 229, 0.2);
    padding-top: 8px;
}

.msg-like-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.msg-like-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.msg-like-btn.liked i {
    color: #e74c3c;
}

.like-btn-large {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    color: white;
    padding: 8px 16px;
    margin-top: 15px;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn-large:hover,
.like-btn-large:active {
    background: rgba(231, 76, 60, 0.6);
    transform: scale(1.05);
}

.like-btn-large.liked i {
    color: #e74c3c;
}

/* Ranking styles additions */
.ranking-card {
    padding: 1.5rem;
}