/* style.css */
:root {
    --primary-color: #1a1a1a; /* black */
    --secondary-color: #333333; /* charcoal */
    --accent-color: #c0c0c0; /* silver */
    --text-main: #e0e0e0;
    --glass-bg: rgba(0, 0, 0, 0.4);
    --glass-border: rgba(192, 192, 192, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 99%, var(--secondary-color) 100%);
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling, contain bubbles */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Animated Stars for depth */
.star {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    z-index: 0;
    opacity: 0.8;
}

.shape-1 {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    top: 15%;
    left: 20%;
    animation: twinkle 3s infinite alternate ease-in-out;
}

.shape-2 {
    width: 4px;
    height: 4px;
    background: #ffffff;
    top: 60%;
    right: 25%;
    animation: twinkle 4s infinite alternate-reverse ease-in-out;
}

.shape-3 {
    width: 5px;
    height: 5px;
    background: var(--accent-color);
    bottom: 20%;
    left: 40%;
    animation: twinkle 5s infinite alternate ease-in-out;
}

@keyframes twinkle {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.5); opacity: 1; }
}

/* Decorative Glassmorphism Icons */
.glass-icon {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform;
    opacity: 0.7;
    z-index: 1;
}

.glass-icon svg {
    width: 100%;
    height: 100%;
    fill: rgba(255, 255, 255, 0.15);
    stroke: rgba(255, 255, 255, 0.7);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* Central Content & Glassmorphism */
.center-content {
    position: relative;
    z-index: 10; /* Above blobs and behind bubbles (we will set bubble z-index carefully) */
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    color: var(--text-main);
}

.glass-panel h1 {
    font-weight: 600;
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.glass-panel p {
    font-weight: 300;
    margin-bottom: 30px;
    color: #ffffff;
}

/* Form Styles */
#wish-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#wish-input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: #1a1a1a;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#wish-input::placeholder {
    color: #666;
}

#wish-input:focus {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), inset 0 2px 4px rgba(0,0,0,0.05);
}

button {
    padding: 15px 30px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(to right, #4a4a4a, #808080);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(128, 128, 128, 0.4);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 128, 128, 0.6);
}

button:active {
    transform: translateY(1px);
}

/* Wishes Container */
#wishes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Let clicks pass through to the form */
    z-index: 5; /* Float BEHIND the central form */
}

/* Floating Bubble Container */
.wish-bubble {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The actual polaroid card */
.polaroid-card {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 10% 10% 25% 10%; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: top center;
    animation: swing 4s infinite ease-in-out alternate;
}

.polaroid-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 30%;
    height: 15px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

@keyframes swing {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

.polaroid-card span {
    font-family: 'Caveat', cursive;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 14px -14px 10px rgba(0, 0, 0, 0.3); /* -45 deg, 20px offset, 10px blur, 30% alpha */
}

/* Admin Delete Button */
.delete-btn {
    display: none;
    position: absolute;
    top: 5%;
    right: 5%;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-weight: bold;
    text-shadow: none;
}

.delete-btn:hover {
    background: #ff1a1a;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

#wishes-container.admin-mode .delete-btn {
    display: flex;
    justify-content: center;
    align-items: center;
}

#wishes-container.admin-mode .wish-bubble {
    pointer-events: auto; /* Enable clicking the delete button in admin mode */
}

/* QR Container */
.qr-container {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-container p {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin: 0;
    line-height: 1.2;
}

#qrcode {
    background: white;
    padding: 10px;
    border-radius: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .qr-container {
        display: none;
    }
    .center-content {
        width: 80%; /* Even smaller container widths */
        max-width: 320px; /* Constrain perfectly */
        padding: 0; /* Let it sit naturally */
    }
    .glass-panel {
        padding: 15px 12px; /* Very tight spacing */
    }
    .glass-panel h1 {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
    .glass-panel p {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    #wish-input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
