/* Antigravity Collage Stylesheet */

/* --- Reset & Base Variables --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-space: #03030c;
    --amethyst: #a855f7;
    --amethyst-glow: rgba(168, 85, 247, 0.35);
    --gold: #e5a910;
    --gold-light: #fbe695;
    --gold-dark: #b8860b;
    --gold-glow: rgba(229, 169, 16, 0.45);
    --silver: #cbd5e1;
    --glass-bg: rgba(12, 12, 30, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-gold: rgba(229, 169, 16, 0.35);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-ui: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --shadow-premium: 0 16px 36px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-space);
    color: var(--text-main);
    font-family: var(--font-ui);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* --- Starfield and Cosmic Nebulae Background --- */
#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.nebula-overlay {
    position: fixed;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.3;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: nebulaFloat 30s infinite alternate ease-in-out;
}

.nebula-overlay.blue {
    background: radial-gradient(circle, var(--cosmic-blue) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.nebula-overlay.purple {
    background: radial-gradient(circle, var(--amethyst) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

.nebula-overlay.gold {
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.12;
    animation-duration: 45s;
    animation-delay: -15s;
}

@keyframes nebulaFloat {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(8%, -5%) scale(1.1) rotate(180deg); }
    100% { transform: translate(-5%, 8%) scale(0.9) rotate(360deg); }
}

/* --- Main App Container --- */
#app-container {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- Header / Interactive Greeting --- */
#greeting-header {
    padding: 35px 20px 10px;
    text-align: center;
    width: 100%;
    z-index: 100;
}

.greeting-text {
    font-family: var(--font-serif);
    font-size: 2.7rem;
    font-weight: 600;
    font-style: italic;
    
    /* Center text block */
    text-align: center;
    margin: 0 auto;
    
    /* Rich gold gradient */
    background: linear-gradient(135deg, #ffe082 0%, var(--gold) 45%, #e6a100 70%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    display: inline-block;
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease, opacity 0.3s;
    
    /* Breathing pulse and initial soft glow */
    animation: titleGlow 4s ease-in-out infinite alternate, heartbeat 2.5s infinite ease-in-out;
}

/* Illuminates on hover */
.greeting-text:hover {
    transform: scale(1.035);
    filter: drop-shadow(0 0 18px rgba(229, 169, 16, 0.85)) brightness(1.25);
}

.greeting-text:active {
    transform: scale(0.98);
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 4px rgba(229, 169, 16, 0.25)); }
    100% { filter: drop-shadow(0 0 10px rgba(229, 169, 16, 0.45)); }
}

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

/* --- Collage Board Workspace --- */
.board-area {
    flex: 1;
    position: relative;
    width: 100vw;
    margin-top: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    perspective: 1200px;
}

/* --- Collage Card wrapper --- */
.collage-card {
    position: absolute;
    cursor: grab;
    user-select: none;
    will-change: transform, left, top;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    z-index: 10;
}

.collage-card:active {
    cursor: grabbing;
}

.collage-card.dragging {
    z-index: 1000 !important;
}

/* --- Glassmorphic polaroid card inner (Clean, no labels) --- */
.card-inner {
    padding: 6px;
    background: rgba(13, 12, 34, 0.75);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
}

/* Thin border detail */
.card-inner::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    pointer-events: none;
    transition: border-color 0.3s;
}

.collage-card:hover .card-inner {
    border-color: rgba(229, 169, 16, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px var(--gold-glow);
}

.collage-card:hover .card-inner::before {
    border-color: rgba(229, 169, 16, 0.35);
}

.card-image {
    width: 140px;
    height: 105px;
    object-fit: cover;
    border-radius: 3px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #03030b;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* --- Bottom Left Floating Heart Button --- */
.floating-heart-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 8px var(--gold-glow);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    text-decoration: none;
    z-index: 1000;
}

.floating-heart-btn:hover {
    transform: scale(1.15) translateY(-3px);
    border-color: var(--gold-light);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 18px var(--gold-glow);
}

.floating-heart-btn:active {
    transform: scale(0.95);
}

/* --- Minimal Instructions (Bottom Right) --- */
#minimal-info {
    position: fixed;
    bottom: 20px;
    right: 25px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-display);
    letter-spacing: 1px;
    pointer-events: none;
    opacity: 0.6;
    z-index: 100;
}

/* --- Special Father's Day Surprise Popup Modal --- */
#fathers-day-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#fathers-day-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 2, 8, 0.88);
    backdrop-filter: blur(15px);
}

#modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 3020;
    transition: color 0.3s, transform 0.3s;
}

#modal-close:hover {
    color: var(--gold-light);
    transform: rotate(90deg);
}

.modal-content {
    position: relative;
    z-index: 3010;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--glass-border-gold);
    border-radius: 20px;
    background: var(--glass-bg);
    animation: zoomPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomPulse {
    from {
        transform: scale(0.7) translateY(40px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.modal-image-frame {
    padding: 10px 10px 10px 10px;
    background: white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    transform: rotate(-3deg);
    border: 1px solid var(--gold-light);
    transition: transform 0.5s ease;
}

.modal-image-frame:hover {
    transform: rotate(2deg) scale(1.02);
}

#modal-random-img {
    width: 340px;
    height: 255px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-greeting-text {
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 600;
    font-style: italic;
    margin-top: 10px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    
    /* Gold-light coloring */
    background: linear-gradient(135deg, #fff 10%, var(--gold-light) 50%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    animation: beatEffect 1.5s infinite alternate ease-in-out;
}

@keyframes beatEffect {
    from { transform: scale(0.98); }
    to { transform: scale(1.03); }
}

/* --- Floating Heart Particles --- */
.heart-particle {
    position: absolute;
    pointer-events: none;
    font-size: 2rem;
    z-index: 15;
    animation: heartFloat 2.5s forwards cubic-bezier(0.1, 0.8, 0.3, 1);
    opacity: 0;
}

@keyframes heartFloat {
    0% {
        transform: translate(0, 0) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.95;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(var(--rot));
        opacity: 0;
    }
}

/* --- Lightbox Zoom Modal --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
}

#lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 2, 8, 0.82);
    backdrop-filter: blur(12px);
}

#lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 3rem;
    cursor: pointer;
    z-index: 2010;
    transition: color 0.3s, transform 0.3s;
}

#lightbox-close:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

.lightbox-content {
    position: relative;
    z-index: 2005;
    width: 90%;
    max-width: 900px;
    height: 70vh;
    max-height: 600px;
    border: 1px solid var(--glass-border-gold);
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    animation: scaleUp 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes scaleUp {
    from {
        transform: scale(0.9) translateY(15px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.lightbox-image-container {
    flex: 3;
    background: #030308;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-details {
    flex: 2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(5, 5, 18, 0.45);
    border-left: 1px solid var(--glass-border);
}

#lightbox-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--gold-light);
    margin-bottom: 15px;
    line-height: 1.2;
}

.lightbox-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
}

.lightbox-actions .action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-actions .action-btn:hover {
    color: var(--gold-light);
    border-color: var(--gold);
    background: rgba(223, 178, 51, 0.08);
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .lightbox-content {
        flex-direction: column;
        height: 85vh;
        max-height: none;
    }
    
    .lightbox-image-container {
        flex: 2;
    }
    
    .lightbox-details {
        flex: 1;
        padding: 20px;
        border-left: none;
        border-top: 1px solid var(--glass-border);
    }
    
    .greeting-text {
        font-size: 1.9rem;
    }
    
    #minimal-info {
        display: none;
    }

    #modal-random-img {
        width: 260px;
        height: 195px;
    }

    .modal-greeting-text {
        font-size: 1.6rem;
    }
}

@media (max-width: 500px) {
    #greeting-header {
        padding: 20px 10px 5px;
    }
    
    .greeting-text {
        font-size: 1.5rem;
    }
    
    .card-image {
        width: 105px;
        height: 78px;
    }

    #modal-random-img {
        width: 200px;
        height: 150px;
    }

    .modal-greeting-text {
        font-size: 1.3rem;
    }
}
