/* ============================================
   PETAL ALBUM FAN TOOL - STYLES
   Clean, minimal, dreamy aesthetic
   ============================================ */

/* ---------- CSS VARIABLES ---------- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #e8b4d6;
    --soft-pink: #f5d5e8;
    --lavender: #d4c5f9;
    --max-width: 500px;
    --mobile-width: 90%;
}

/* ---------- KEYFRAMES FOR ANIMATIONS ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Panamericana", "Playfair Display", "Cormorant Garamond", serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(20px, 5vh, 60px) 20px;
}

/* ---------- BACKGROUND LAYER ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, 
            rgba(245, 213, 232, 0.3) 0%, 
            rgba(212, 197, 249, 0.2) 50%, 
            transparent 100%
        ),
        url('https://cdn.shopify.com/s/files/1/0087/7943/1993/files/mwoi8-pl54f-22qbv.png?v=1777386804') 
        no-repeat center center / cover;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    filter: brightness(0.85) saturate(1.1);
    z-index: -2;
}

/* ---------- PARTICLES CANVAS ---------- */
.particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* ---------- MAIN CONTAINER ---------- */
.main-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: clamp(20px, 5vh, 40px) 20px;
    position: relative;
    z-index: 2;
    background: transparent;
    animation: fadeInUp 1s ease-out;
}

/* ---------- LOGO IMAGE ---------- */
.logo-image {
    width: clamp(150px, 40vw, 300px);
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 20px rgba(232, 180, 214, 0.3));
    transition: transform 0.3s ease;
    animation: fadeIn 1.2s ease-out, float 6s ease-in-out infinite;
}

.logo-image:hover {
    transform: scale(1.02);
}

/* ---------- ALBUM COVER IMAGE (no background, simple) ---------- */
.album-cover-image {
    width: clamp(200px, 50vw, 400px);
    height: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 8px 32px rgba(232, 180, 214, 0.2));
    transition: transform 0.3s ease;
    animation: fadeIn 1.4s ease-out;
}

.album-cover-image:hover {
    transform: scale(1.01);
}

/* ---------- PRE-SAVE BUTTON ---------- */
.presave-btn {
    position: relative;
    display: inline-block;
    width: clamp(200px, 50vw, 350px);
    text-decoration: none;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(232, 180, 214, 0.2);
    animation: fadeIn 1.6s ease-out;
}

.presave-btn:hover {
    transform: scale(1.03);
}

.presave-bg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    animation: pulse 4s ease-in-out infinite;
}

.presave-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: "Panamericana", "Playfair Display", serif;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 300;
    text-transform: lowercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* ---------- TEXT GENERATOR (CSS background, inputs visible) ---------- */
.text-generator {
    width: clamp(280px, 70vw, 400px);
    background-image: url('https://cdn.shopify.com/s/files/1/0087/7943/1993/files/mwoi8-pl54f-22qbv.png?v=1777386804');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: clamp(20px, 4vw, 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 3vw, 20px);
    box-shadow: 0 8px 32px rgba(232, 180, 214, 0.2);
    animation: fadeInUp 1.8s ease-out;
}

/* ---------- INPUT AREA ---------- */
.input-area {
    width: 100%;
}

#text-input {
    width: 100%;
    padding: 12px 20px;
    font-family: "Panamericana", "Playfair Display", "Cormorant Garamond", serif;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 300;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

#text-input::placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-size: clamp(12px, 2vw, 14px);
}

#text-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(232, 180, 214, 0.15);
}

/* ---------- CONTROLS PANEL (smaller, minimal) ---------- */
.controls-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control label {
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control label span {
    color: var(--soft-pink);
    font-weight: 400;
}

/* Slider styling (thinner, more subtle) */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5px;
    outline: none;
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--soft-pink);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(232, 180, 214, 0.3);
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--soft-pink);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(232, 180, 214, 0.3);
}

/* Color picker (smaller) */
.color-picker {
    -webkit-appearance: none;
    appearance: none;
    width: 50px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    padding: 1px;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Toggle switch (smaller) */
.toggle-control {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.toggle {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle:checked {
    background: var(--soft-pink);
}

.toggle:checked::before {
    transform: translateX(20px);
}

/* ---------- LIVE PREVIEW (smaller, with black background for visibility) ---------- */
.live-preview {
    max-width: 300px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 15px rgba(232, 180, 214, 0.15));
    background: #000 !important;
}

/* ---------- DOWNLOAD BUTTON (smaller, more authentic) ---------- */
.download-btn {
    width: 100%;
    min-height: 40px;
    padding: 12px 24px;
    font-family: "Panamericana", "Playfair Display", "Cormorant Garamond", serif;
    font-size: clamp(13px, 2.5vw, 15px);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(232, 180, 214, 0.05);
    text-transform: lowercase;
    letter-spacing: 2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 2s ease-out;
}

.download-btn:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(232, 180, 214, 0.1);
}

.download-btn:active {
    transform: scale(0.98);
}

/* ---------- WELCOME POPUP ---------- */
.welcome-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease-out;
    /* Blur the background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
}

.welcome-content {
    position: relative;
    width: clamp(320px, 80vw, 500px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(232, 180, 214, 0.3);
    animation: fadeInUp 0.8s ease-out;
    cursor: pointer;
    /* Grainy texture overlay */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="200" height="200" filter="url(%23noise)" opacity="0.1"/></svg>');
    background-size: cover;
}

.welcome-bg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

.welcome-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: "Panamericana", "Playfair Display", serif;
    font-size: clamp(16px, 3.5vw, 24px);
    font-weight: 300;
    text-transform: lowercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    white-space: normal;
    pointer-events: none;
    z-index: 2;
    text-align: center;
    line-height: 1.5;
    width: 90%;
    max-height: 85%;
    overflow-y: auto;
    padding: 15px;
}

.welcome-text span {
    display: block;
}

.welcome-text span:first-child {
    font-size: 1.3em;
    margin-bottom: 10px;
}

.welcome-text span:nth-child(2) {
    font-size: 0.65em;
    margin-top: 15px;
    opacity: 0.7;
    letter-spacing: 1px;
    display: block;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

.welcome-text span:last-child {
    font-size: 0.5em;
    margin-top: 25px;
    opacity: 0.5;
    letter-spacing: 0.5px;
    line-height: 1.8;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
}

/* Hide popup when clicked */
.welcome-popup.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.disclaimer p {
    font-size: clamp(10px, 2vw, 12px);
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .glass-card {
        border-radius: 20px;
    }

    .controls-panel {
        gap: 16px;
    }

    #text-input {
        padding: 14px 20px;
    }

    .download-btn {
        padding: 14px 28px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .glass-card {
        padding: 20px;
    }

    .live-preview {
        min-height: 100px;
    }
}
