/* ==========================================================================
   ROMANTIC HEART PARTICLES WEBSITE DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-color: #050811;
    --primary-love: #ff5e97;
    --primary-love-glow: rgba(255, 94, 151, 0.5);
    --primary-love-light: #ff8cb3;
    --text-color: #ffffff;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-script: 'Alex Brush', cursive;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Heart Canvas Styles */
#heart-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto; /* Allow clicking to trigger explosion */
}

/* Center Content (Text overlapping canvas) */
.center-content {
    position: absolute;
    z-index: 2;
    text-align: center;
    pointer-events: none; /* Let mouse moves pass to canvas */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInScale 2.5s ease-out;
}

.love-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 4rem;
    font-weight: 400;
    color: var(--primary-love);
    letter-spacing: 0.05em;
    text-shadow: 
        0 0 10px var(--primary-love-glow),
        0 0 20px var(--primary-love-glow),
        0 0 40px rgba(255, 94, 151, 0.3),
        0 0 60px rgba(255, 94, 151, 0.2);
    margin-bottom: 0.5rem;
    animation: heartbeat 2s infinite alternate ease-in-out;
}

.click-hint {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    animation: pulse-glow 3s infinite ease-in-out;
}

/* Bottom Actions Area */
.bottom-actions {
    position: absolute;
    bottom: 12%;
    z-index: 3;
    display: flex;
    justify-content: center;
    width: 100%;
    animation: fadeInUp 2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glowing Button Styling */
.glow-btn {
    background: rgba(255, 94, 151, 0.08);
    border: 1px solid rgba(255, 94, 151, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.glow-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 94, 151, 0.2);
    border-color: var(--primary-love);
    box-shadow: 
        0 8px 30px rgba(255, 94, 151, 0.4),
        0 0 15px rgba(255, 94, 151, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.glow-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.15rem;
    animation: swing 1.5s infinite ease-in-out alternate;
    display: inline-block;
}

/* Romantic Glassmorphism Love Letter Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.letter-card {
    width: 90%;
    max-width: 550px;
    background: rgba(18, 12, 18, 0.8);
    border: 1px solid rgba(255, 94, 151, 0.25);
    border-radius: 28px;
    padding: 2.2rem 2.5rem;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(255, 94, 151, 0.1),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .letter-card {
    transform: scale(1) translateY(0);
}

/* Decorative backdrop glow for the card */
.letter-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 94, 151, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Letter Close Button */
.letter-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.close-btn svg {
    width: 1rem;
    height: 1rem;
}

.close-btn:hover {
    background: rgba(255, 94, 151, 0.2);
    border-color: var(--primary-love);
    color: #ffffff;
    transform: rotate(90deg);
}

/* Letter Body Styling */
.letter-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.letter-greeting {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-love);
    letter-spacing: -0.01em;
    border-bottom: 1px dashed rgba(255, 94, 151, 0.15);
    padding-bottom: 0.75rem;
}

.letter-message {
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    min-height: 150px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.5rem;
    white-space: pre-wrap; /* Preserve spacing/linebreaks */
    letter-spacing: 0.02em;
}

/* Custom Scrollbar for letter */
.letter-message::-webkit-scrollbar {
    width: 4px;
}
.letter-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.letter-message::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 151, 0.2);
    border-radius: 2px;
}

/* Typewriter Cursor */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    background-color: var(--primary-love);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink-cursor 0.75s step-end infinite;
}

.letter-signature {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.signature-name {
    font-family: var(--font-script);
    font-size: 2.2rem;
    color: var(--primary-love);
    text-shadow: 0 0 8px rgba(255, 94, 151, 0.2);
}

/* Elegant Music Toggle Button */
.music-wrapper {
    position: absolute;
    bottom: 5%;
    right: 5%;
    z-index: 10;
}

.music-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.music-toggle:hover {
    background: rgba(255, 94, 151, 0.15);
    border-color: rgba(255, 94, 151, 0.4);
    color: var(--primary-love);
    transform: scale(1.08);
}

.music-icon {
    width: 1.4rem;
    height: 1.4rem;
    transition: transform 0.3s ease;
}

/* Vinyl Rotate Animation */
.music-icon.playing {
    animation: spin-vinyl 12s linear infinite;
    color: var(--primary-love);
}

/* Tooltip message for music play instruction */
.music-tooltip {
    position: absolute;
    right: 125%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 94, 151, 0.25);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.music-toggle:hover .music-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-5px);
}

/* Custom soundwaves/pulse effect for active music */
.music-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--primary-love);
    opacity: 0;
    pointer-events: none;
}

.music-icon.playing ~ .music-pulse {
    animation: music-ripple 2s infinite ease-out;
}

/* ==========================================================================
   SETTINGS / CUSTOMIZER STYLING
   ========================================================================== */

/* Settings Toggle Button in top-left */
.settings-toggle {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 90;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-toggle svg {
    width: 1.3rem;
    height: 1.3rem;
    transition: transform 0.6s ease;
}

.settings-toggle:hover {
    background: rgba(255, 94, 151, 0.15);
    border-color: rgba(255, 94, 151, 0.4);
    color: var(--primary-love);
    transform: scale(1.08);
}

.settings-toggle:hover svg {
    transform: rotate(90deg);
}

/* Glassmorphic Settings Slide Drawer */
.settings-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 360px;
    max-width: 90%;
    background: rgba(12, 8, 12, 0.88);
    border-right: 1px solid rgba(255, 94, 151, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 0 50px rgba(0, 0, 0, 0.8),
        5px 0 30px rgba(255, 94, 151, 0.08);
    display: flex;
    flex-direction: column;
}

.settings-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid rgba(255, 94, 151, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-love);
    letter-spacing: -0.01em;
}

.drawer-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.drawer-close:hover {
    color: var(--primary-love);
}

.drawer-body {
    padding: 1.5rem 1.8rem;
    flex: 1;
    overflow-y: auto;
}

/* Custom Scrollbar for drawer */
.drawer-body::-webkit-scrollbar {
    width: 4px;
}
.drawer-body::-webkit-scrollbar-track {
    background: transparent;
}
.drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 151, 0.15);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    font-size: 0.775rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-love);
    background: rgba(255, 94, 151, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 94, 151, 0.15);
}

.form-group textarea {
    resize: none;
}

.form-group select option {
    background-color: #0c080c;
    color: #ffffff;
}

.help-text {
    display: block;
    font-size: 0.675rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Styled file input for music & photos */
.form-group input[type="file"] {
    width: 100%;
    background: rgba(255, 94, 151, 0.04);
    border: 1px dashed rgba(255, 94, 151, 0.35);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-love);
    background: rgba(255, 94, 151, 0.08);
    color: #ffffff;
}

.form-group input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, var(--primary-love) 0%, #ff2a74 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.6rem;
    transition: opacity 0.2s ease;
}

.form-group input[type="file"]::-webkit-file-upload-button:hover {
    opacity: 0.85;
}

/* Save settings action button */
.save-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-love) 0%, #ff2a74 100%);
    border: none;
    border-radius: 14px;
    padding: 0.9rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(255, 94, 151, 0.35);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 94, 151, 0.55);
}

.save-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   FLOATING POLAROID PHOTOS & GALLERY
   ========================================================================== */

#floating-photos-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.floating-photo {
    position: absolute;
    width: 130px;
    background: #ffffff;
    padding: 8px 8px 24px 8px;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.floating-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 2px;
    pointer-events: none;
}

.floating-photo .photo-caption {
    font-family: var(--font-script);
    font-size: 1.25rem;
    color: #333333;
    text-align: center;
    margin-top: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.1;
    pointer-events: none;
}

.floating-photo:hover {
    box-shadow: 
        0 15px 35px rgba(255, 94, 151, 0.45), 
        0 0 15px rgba(255, 94, 151, 0.25);
    border-color: var(--primary-love);
    z-index: 100 !important;
}

/* Photo grid in Drawer */
.photo-manage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    border: 1px dashed rgba(255, 94, 151, 0.2);
    border-radius: 8px;
}

.photo-manage-grid::-webkit-scrollbar {
    width: 3px;
}
.photo-manage-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 151, 0.3);
    border-radius: 2px;
}

.photo-manage-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.photo-manage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-manage-item .delete-photo-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(244, 63, 94, 0.85);
    color: #ffffff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}

.photo-manage-item .delete-photo-btn:hover {
    background: rgb(244, 63, 94);
    transform: scale(1.1);
}

/* Polaroid Romantic Viewer Modal Card */
.viewer-card {
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    padding: 14px 14px 44px 14px;
    border-radius: 8px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(255, 94, 151, 0.15);
    transform: scale(0.9) translateY(30px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .viewer-card {
    transform: scale(1) translateY(0);
}

.viewer-card .close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.viewer-card .close-btn:hover {
    background: rgba(255, 94, 151, 0.3);
    border-color: var(--primary-love);
    transform: rotate(90deg);
}

.viewer-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #f7f7f7;
}

.viewer-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer-caption {
    font-family: var(--font-script);
    font-size: 2rem;
    color: #333333;
    margin-top: 14px;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes heartbeat {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.85; text-shadow: 0 0 8px rgba(255, 255, 255, 0.2); }
}

@keyframes spin-vinyl {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes music-ripple {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

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

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); filter: blur(5px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes blink-cursor {
    from, to { background-color: transparent }
    50% { background-color: var(--primary-love) }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .love-text {
        font-size: 3.2rem;
    }
    
    .letter-card {
        padding: 1.8rem 1.8rem;
    }
    
    .letter-greeting {
        font-size: 1.3rem;
    }
    
    .letter-message {
        font-size: 0.9rem;
        line-height: 1.65;
    }
}
