/* =========================================
   BOTANICAL SANCTUARY — Yellow & Green Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- CSS Variables ---- */
:root {
    --leaf-dark:    #1a3a1f;
    --leaf-mid:     #2d6a35;
    --leaf-light:   #4e9c57;
    --sage:         #7abf75;
    --mint-soft:    #b8e0b0;
    --yellow-gold:  #f5c518;
    --yellow-warm:  #f9d94e;
    --yellow-pale:  #fef7d0;
    --yellow-glow:  #fffae8;
    --cream:        #fdfdf5;
    --white-glass:  rgba(255,255,255,0.72);
    --shadow-leaf:  rgba(26, 58, 31, 0.18);
    --shadow-gold:  rgba(245, 197, 24, 0.25);
    --text-dark:    #1a2e1c;
    --text-mid:     #3b5e41;
    --text-soft:    #7a9f7e;
    --border-soft:  rgba(78, 156, 87, 0.2);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--yellow-glow);
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---- Organic Background Texture ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(122,191,117,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 80%, rgba(245,197,24,0.22) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(184,224,176,0.12) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Floating leaf shapes */
.login-body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle 3px at 20% 30%, rgba(78,156,87,0.4) 0%, transparent 3px),
        radial-gradient(circle 2px at 75% 20%, rgba(245,197,24,0.5) 0%, transparent 2px),
        radial-gradient(circle 4px at 60% 70%, rgba(78,156,87,0.3) 0%, transparent 4px),
        radial-gradient(circle 2px at 30% 80%, rgba(245,197,24,0.4) 0%, transparent 2px),
        radial-gradient(circle 3px at 88% 55%, rgba(122,191,117,0.35) 0%, transparent 3px);
    pointer-events: none;
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 10;
    background: var(--white-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding: 90px 88px 84px;
    border-radius: 44px;
    border: 1px solid rgba(255,255,255,0.85);
    box-shadow:
        0 4px 6px var(--shadow-leaf),
        0 20px 50px rgba(26,58,31,0.12),
        0 0 0 1px rgba(78,156,87,0.15),
        inset 0 1px 0 rgba(255,255,255,0.9);
    text-align: center;
    width: 640px;
    animation: cardIn 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative top stripe */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 4px;
    background: linear-gradient(90deg, var(--leaf-mid), var(--yellow-gold), var(--leaf-light), var(--yellow-warm));
    border-radius: 0 0 4px 4px;
}

.heart-header {
    font-size: 3.8rem;
    margin-bottom: 10px;
    display: block;
    animation: heartPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(245,197,24,0.6));
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

.login-card h1 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--leaf-dark);
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 36px;
    letter-spacing: -0.02em;
}

.login-card h1 span {
    color: var(--leaf-mid);
    font-style: normal;
    font-weight: 700;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-card input {
    width: 100%;
    padding: 22px 28px;
    background: rgba(254,247,208,0.6);
    border: 2px solid var(--border-soft);
    border-radius: 18px;
    font-size: 1.25rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-align: center;
    color: var(--leaf-dark);
    outline: none;
    transition: all 0.3s ease;
}

.login-card input::placeholder {
    letter-spacing: 0.05em;
    color: var(--text-soft);
    font-weight: 300;
    font-size: 0.95rem;
}

.login-card input:focus {
    border-color: var(--yellow-gold);
    background: rgba(255,250,232,0.9);
    box-shadow: 0 0 0 4px rgba(245,197,24,0.15), 0 4px 12px rgba(26,58,31,0.08);
    transform: translateY(-1px);
}

.login-card button {
    background: linear-gradient(135deg, var(--leaf-mid) 0%, var(--leaf-dark) 100%);
    color: var(--yellow-pale);
    border: none;
    padding: 22px 48px;
    border-radius: 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    overflow: hidden;
}

.login-card button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--yellow-gold) 0%, var(--yellow-warm) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.login-card button:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px var(--shadow-leaf), 0 0 20px var(--shadow-gold);
    color: var(--leaf-dark);
}

.login-card button:hover::before { opacity: 1; }

.login-card button span { position: relative; z-index: 1; }

.login-card button:active { transform: translateY(0) scale(0.99); }

.error-msg {
    margin-top: 18px;
    color: #b85c1a;
    background: rgba(248,215,120,0.35);
    border: 1px solid rgba(184,92,26,0.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */

.gallery-content {
    position: relative;
    z-index: 10;
    padding: 60px 24px 80px;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 64px;
    position: relative;
}

header::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--leaf-mid), var(--yellow-gold));
    margin: 20px auto 0;
    border-radius: 3px;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    font-style: italic;
    color: var(--leaf-dark);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 0;
}

header h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--yellow-gold), var(--leaf-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--text-soft);
    font-size: 1.15rem;
    margin-top: 10px;
}

/* Photo Grid */
.main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 32px;
    max-width: 1240px;
    margin: 0 auto;
}

.photo-frame {
    background: var(--cream);
    padding: 14px 14px 40px;
    border-radius: 4px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.06),
        0 8px 20px var(--shadow-leaf),
        0 20px 40px rgba(26,58,31,0.07);
    transform: rotate(var(--rotation, -1.5deg));
    transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.4s ease;
    cursor: pointer;
    position: relative;
}

/* Tape effect */
.photo-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 22px;
    background: rgba(245,197,24,0.5);
    border-radius: 2px;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.photo-frame:nth-child(2n)   { --rotation: 1.8deg; }
.photo-frame:nth-child(3n)   { --rotation: -2.5deg; }
.photo-frame:nth-child(4n)   { --rotation: 2.2deg; }
.photo-frame:nth-child(5n)   { --rotation: -1deg; }

.photo-frame:hover {
    transform: rotate(0deg) scale(1.06) translateY(-8px);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.08),
        0 20px 50px var(--shadow-leaf),
        0 30px 60px rgba(26,58,31,0.12),
        0 0 0 2px rgba(245,197,24,0.35);
    z-index: 20;
}

.photo-frame img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

/* Caption-style label under photo */
.photo-frame .frame-label {
    display: block;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--text-soft);
    font-size: 0.85rem;
    margin-top: 10px;
    letter-spacing: 0.02em;
}

/* ============================================================
   RAINING IMAGES ANIMATION
   ============================================================ */

#rain-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.rain-item {
    position: absolute;
    top: -160px;
    width: 90px;
    opacity: 0;
    border-radius: 6px;
    border: 3px solid rgba(255,255,255,0.75);
    box-shadow: 0 4px 12px rgba(26,58,31,0.2), 0 0 8px rgba(245,197,24,0.15);
    animation: fall linear forwards;
    filter: drop-shadow(0 2px 6px rgba(26,58,31,0.15));
}

@keyframes fall {
    0%   { opacity: 0; transform: translateY(0) rotate(0deg) scale(0.8); }
    8%   { opacity: 0.65; }
    90%  { opacity: 0.55; }
    100% { opacity: 0; transform: translateY(110vh) rotate(400deg) scale(1); }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 17, 0.93);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: lbIn 0.3s ease both;
}

@keyframes lbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#lightbox.open { display: flex; }

#lightbox img {
    max-width: 88%;
    max-height: 82vh;
    border-radius: 4px;
    border: 10px solid var(--cream);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,197,24,0.25);
    animation: imgPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes imgPop {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Close hint */
#lightbox::after {
    content: 'Click anywhere to close';
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(254,247,208,0.45);
}

/* ============================================================
   DECORATIVE LEAF ACCENTS (CSS-only)
   ============================================================ */

.leaf-accent {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--yellow-gold);
    border-radius: 0 50% 0 50%;
    transform: rotate(45deg);
    margin: 0 8px;
    opacity: 0.7;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--yellow-pale); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--leaf-light), var(--yellow-gold));
    border-radius: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .login-card { width: 90vw; padding: 44px 28px; }
    .login-card h1 { font-size: 2rem; }
    header h1 { font-size: 2rem; }
    .main-grid { grid-template-columns: 1fr; gap: 24px; }
    .photo-frame img { height: 260px; }
}