/*
===================================================================
MAIN STYLESHEET for Festival Greeting Script
===================================================================

This file controls the entire look and feel of your website.
To customize your site's appearance (colors, fonts, etc.),
edit the variables in the :root section below.

===================================================================
*/


/*
===================================================================
SITE-WIDE THEME & COLOR CONFIGURATION
===================================================================
Edit the values below to match your brand.
*/
:root {
    /* --- Fonts --- */
    /* Set the primary font for headings */
    --font-heading: 'Poppins', sans-serif;
    /* Set the default font for all other text */
    --font-body: 'Inter', sans-serif;

    /* --- Primary Colors --- */
    /* Main dark background color */
    --primary-color-dark: #050a14;
    /* Bright accent/highlight color (e.g., for links and titles) */
    --primary-color-light: #00F2FF;
    /* A slightly different shade of the bright accent */
    --accent-color-light: #89F7FF;

    /* --- Text Colors --- */
    /* Default light text color on dark backgrounds */
    --text-color: #e0e0e0;
    /* Dark text color for light backgrounds (e.g., on buttons) */
    --text-color-dark: #050a14;
    /* Pure white text */
    --text-color-light: #ffffff;

    /* --- "Glass" Effect --- */
    /* Background color of the glass panels (use 'rgba' for transparency) */
    --glass-bg: rgba(10, 25, 47, 0.5);
    /* Border color of the glass panels */
    --glass-border-color: rgba(0, 242, 255, 0.25);
    /* Shadow for the glass panels */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    /* Glow effect on hover */
    --glow-shadow: 0 0 20px rgba(0, 242, 255, 0.4), 0 0 8px rgba(0, 242, 255, 0.3);

    /* --- Button Colors --- */
    /* Gradient for primary "Shop Now" buttons */
    --button-primary-gradient: linear-gradient(45deg, var(--primary-color-light), var(--accent-color-light));
    /* Gradient for secondary "Share" buttons */
    --button-secondary-gradient: linear-gradient(45deg, rgba(40, 60, 90, 0.7), rgba(20, 40, 70, 0.7));
    /* Gradient for WhatsApp share button */
    --button-whatsapp-gradient: linear-gradient(45deg, #2ecc71, #27ae60);
    /* Gradient for Download button */
    --button-download-gradient: linear-gradient(45deg, #3498db, #2980b9);

    /* --- Form Input Fields --- */
    /* Background for text boxes (e.g., "Your Name") */
    --input-field-bg: rgba(0, 0, 0, 0.2);
    /* Text color inside the text boxes */
    --input-text-color: #ffffff;

    /* --- Border Radius (Roundness) --- */
    /* Large roundness (for main cards) */
    --border-radius-lg: 20px;
    /* Medium roundness (for inner elements) */
    --border-radius-md: 12px;
    /* Small roundness (for minor elements) */
    --border-radius-sm: 8px;
}

/*
===================================================================
GENERAL STYLES & LAYOUT
===================================================================
*/

/* Basic reset for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-color-dark);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- Background Video --- */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-color: var(--primary-color-dark);
    overflow: hidden;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark overlay on top of the video to make text readable */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10, 25, 47, 0.3) 0%, rgba(5, 10, 20, 0.8) 100%);
    z-index: -2;
}

/* --- Main Content Containers --- */
.main-container,
.bg-selection-container,
.shop-container {
    flex-grow: 1;
}

/*
===================================================================
BENTO GRID (Main Page Layout)
===================================================================
*/

.main-container.bento-grid-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* This is the main "Glass" panel style */
.bento-grid-item {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-color);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 180px;
}

/* Hover glow effect for panels */
.bento-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow-shadow);
}

.bento-grid-item h3 {
    font-size: 1.3rem;
    color: var(--primary-color-light); /* Uses the bright accent color */
    margin-bottom: 10px;
}

.bento-grid-item p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/*
===================================================================
GREETING CARD & CUSTOMIZATION FORM
===================================================================
*/
.greeting-bento-item {
    min-height: 420px;
}

.card-container {
    width: 100%;
    perspective: 1000px;
    position: relative;
    flex-grow: 1;
    min-height: 0;
}

/* Styles for the flippable card (front and back) */
.greeting-card,
.customization-form {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Front of the card */
.greeting-card {
    background: rgba(10, 25, 47, 0.2);
    padding: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Back of the card (the form) */
.customization-form {
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    padding: 25px;
    transform: rotateY(180deg);
}

/* These classes handle the flip animation */
.card-container.flipped .greeting-card {
    transform: rotateY(-180deg);
}

.card-container.flipped .customization-form {
    transform: rotateY(0deg);
}

/* Background image/color element *inside* the card */
.card-inner-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    background-size: cover;
    background-position: center;
    z-index: -1;
    border-radius: var(--border-radius-lg);
}

/* Wrapper for the text content on the card */
.card-content-wrapper {
    position: relative;
    z-index: 2;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    border-radius: var(--border-radius-md);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Greeting message text */
.quote,
.from-name {
    text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.7);
}

.quote {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    flex-grow: 1;
    overflow-y: auto;
    text-align: center;
    margin-bottom: 15px;
    max-height: 180px;
}

/* "From: [Name]" text */
.from-name {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    border: 1px solid rgba(0, 242, 255, 0.2);
    align-self: center;
    flex-shrink: 0;
}

/* --- Customization Form Fields --- */
.customization-form h2 {
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.customization-form textarea,
.customization-form input {
    width: 100%;
    padding: 12px 18px;
    margin-bottom: 15px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border-color);
    background: var(--input-field-bg);
    color: var(--input-text-color);
    font-family: var(--font-body);
    font-size: 1rem;
}

/*
===================================================================
BUTTON STYLES
===================================================================
*/

/* Base style for all action buttons */
.action-button {
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Hover effect for all buttons */
.action-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow-shadow);
}

/* Primary button (e.g., "Shop Now", "Update") - uses --button-primary-gradient */
.action-button.primary {
    background: var(--button-primary-gradient);
    color: var(--text-color-dark);
}

/* Secondary button (e.g., "Share", "Change BG") - uses --button-secondary-gradient */
.action-button.secondary {
    background: var(--button-secondary-gradient);
    color: var(--text-color-light);
    border: 1px solid var(--glass-border-color);
}

/* WhatsApp-specific button - uses --button-whatsapp-gradient */
.action-button.whatsapp {
    background: var(--button-whatsapp-gradient);
    color: var(--text-color-light);
}

/* Download-specific button - uses --button-download-gradient */
.action-button.download {
    background: var(--button-download-gradient);
    color: var(--text-color-light);
}

.bento-grid-item .action-button {
    width: fit-content;
    align-self: center;
}

/* --- Small Control/Close Buttons --- */

/* Style for Music Toggle and Modal Close buttons */
.control-btn,
.close-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-color);
    box-shadow: var(--glass-shadow);
    color: var(--text-color-light);
}

/* Music toggle button (top-left) */
.control-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    z-index: 100;
}

/* Close 'X' button (top-right of forms/modals) */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    z-index: 10;
}

/*
===================================================================
SHARE MODAL (POPUP)
===================================================================
*/

/* Full-screen overlay for the modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Class added by JavaScript to show the modal */
.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* The modal content box */
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    position: relative;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: var(--glass-shadow);
    /* Ensures modal is scrollable on small screens */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-share-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- QR Code Styling (Inside Modal) --- */
#modal-qrcode-display-area {
    margin-top: 30px;
}

/* This is the "sticker" that contains the QR code */
#qr-code-sticker {
    background: #111;
    border: 1px solid var(--glass-border-color);
    padding: 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: inline-block;
}

.qr-code-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color-light);
}

/* The QR code image itself */
#qr-code-image {
    background-color: white; /* QR codes need a white background */
    padding: 10px;
    border-radius: var(--border-radius-sm);
    margin: 15px auto;
    display: inline-block;
    line-height: 0;
}

#qr-code-image img {
    max-width: 100%;
}

.qr-code-from {
    font-size: 0.9em;
    margin-top: 5px;
    color: var(--text-color);
    font-style: italic;
}

#modal-download-qr-btn {
    width: 100%;
    margin-top: 20px;
}

/*
===================================================================
OTHER PAGES (BACKGROUND & SHOP)
===================================================================
*/
.bg-selection-container,
.shop-container {
    padding: 40px 20px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-header {
    padding: 15px;
    margin: 0 auto 20px auto;
}

.bg-header h1,
.shop-container > h1 {
    font-size: 1.8rem;
    color: var(--primary-color-light);
}

.bg-header h2 {
    font-size: 1.5rem;
    color: var(--text-color-light);
    margin-top: 25px;
}

/* --- Grids for selection --- */
.bg-grid,
.product-grid,
.music-grid {
    display: grid;
    gap: 15px;
}

/* Background image/video selection grid */
.bg-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Shop page product grid */
.product-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Music selection grid */
.music-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Individual background item */
.bg-item {
    border: 2px solid var(--glass-border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    height: 120px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-item:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-shadow);
    border-color: var(--accent-color-light);
}

.bg-item.selected {
    border-color: var(--accent-color-light);
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-color-light);
}

.bg-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.bg-item .overlay-text {
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

/* Individual music selection item */
.music-item {
    background: var(--button-secondary-gradient);
    border: 1px solid var(--glass-border-color);
    color: var(--text-color-light);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.music-item.selected {
    background: var(--button-primary-gradient);
    color: var(--text-color-dark);
    box-shadow: var(--glow-shadow);
}

/* --- Shop Page Card --- */
/* This styles one product card on the shop.html page */
.product-card-shop {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.product-card-shop img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.product-card-shop h3 {
    margin-bottom: auto;
}

.product-card-shop p {
    flex-grow: 1;
}

.price-tag-wrapper {
    text-align: right;
    margin: 15px 0;
}

.price {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--glass-border-color);
    color: var(--accent-color-light);
    padding: 5px 15px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 600;
    font-size: 1.1rem;
}

/*
===================================================================
FOOTER
===================================================================
*/

/*
EDITABLE: This is your footer.
It's a good place to add your copyright, company name, or extra links.
This is loaded by footer.js, or you can hard-code it in your HTML.
*/
.site-footer {
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--glass-border-color);
    padding: 30px 15px;
    text-align: center;
    font-size: 0.8rem;
    width: 100%;
}

.footer-links a {
    color: var(--primary-color-light);
    margin: 0 8px;
}

/*
===================================================================
MISC & RESPONSIVE DESIGN
===================================================================
*/

/* Color picker for text (hidden by default) */
.color-picker-container {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.color-picker-container label {
    font-size: 0.9rem;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 50%;
    border: 2px solid var(--glass-border-color);
}

input[type="color"]::-moz-color-swatch {
    border-radius: 50%;
    border: 2px solid var(--glass-border-color);
}

/* --- Responsive Styles (for tablets and desktops) --- */

/* Styles for Tablet (e.g., iPad) */
@media (min-width: 768px) {
    .main-container.bento-grid-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        padding: 60px 30px;
    }

    .greeting-bento-item {
        grid-column: 1 / -1; /* Makes the greeting card span full width */
        min-height: 450px;
    }

    .quote {
        font-size: 1.5rem;
    }

    .bg-header h1,
    .shop-container > h1 {
        font-size: 2.2rem;
    }
}

/* Styles for Desktop */
@media (min-width: 1024px) {
    .main-container.bento-grid-container {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(180px, auto);
    }

    .greeting-bento-item {
        grid-column: span 2; /* Card takes 2/3 width */
        grid-row: span 2;
    }
}