/* 
 * Valentine's Website - Unified Design System
 * Aesthetic: iOS / Glassmorphism
 */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* Game Styles */
@import url('assets/css/games/hex-game.css');
@import url('assets/css/games/lights-out.css');
@import url('assets/css/games/rhythm-tapper.css');
@import url('assets/css/games/anagram-twist.css');
@import url('assets/css/games/futoshiki.css');

/* Theme Variables */
:root {
    /* Colors */
    --primary-maroon: #530909;
    --primary-dark: #2d0404;
    --accent-gold: #efffb7;
    /* Keeping original accent */
    --accent-orange: #e77a27;
    /* Keeping original secondary */
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);

    /* Gradients */
    --bg-gradient: linear-gradient(135deg, var(--primary-maroon) 0%, var(--primary-dark) 100%);
    --background-gradient: linear-gradient(135deg, #530909 0%, #2d0404 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-amount: 10px;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Layout */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --header-height: 80px;
}

/* Prevent Layout Shift */
#header-placeholder {
    min-height: var(--header-height);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-white);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    color: var(--accent-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 2rem;
    color: var(--accent-gold);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: inline-block;
}

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Layout Utilities */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.center-text {
    text-align: center;
}

.home {
    text-align: center;
    padding: 2rem 1rem 0;
}

.home-arcade-link {
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem 0;
}

.arcade-launch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-sm);
    background: var(--accent-orange);
    color: var(--text-white);
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(231, 122, 39, 0.35);
}

.arcade-launch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(231, 122, 39, 0.5);
}

/* Navigation - Glassmorphic Sticky Header */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--header-height);
    background: rgba(83, 9, 9, 0.85);
    /* Slightly transparent maroon */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-white);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--accent-gold);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Glass Panels & Cards */
.glass-panel,
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}

.glass-panel:hover {
    background: var(--glass-bg-hover);
}

/* Map Styling */
#memories-map {
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    /* Leaflet override */
    z-index: 1;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.visited {
    background-color: #4CAF50;
}

.legend-dot.planned {
    background-color: #FF9800;
}

/* Photo Grid */
.photo-grid,
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.photo-item,
.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
    /* Standardize specific ratio */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
}

.photo-item img,
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* No distortion */
    transition: transform 0.5s ease;
}

.photo-item:hover img,
.gallery-item:hover img {
    transform: scale(1.05);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-caption {
    transform: translateY(0);
}

/* Letters */
.Letter {
    max-width: 800px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.9);
    /* Paper-like but glassy */
    color: #111;
    /* Dark text for readability on paper */
    padding: 3rem;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    position: relative;
    font-family: var(--font-heading);
    /* Serif for letters */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--accent-orange);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(231, 122, 39, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 122, 39, 0.6);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-nav {
        padding: 0 1.5rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(45, 4, 4, 0.98);
        padding: 2rem;
        gap: 1.5rem;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .Letter {
        padding: 1.5rem;
    }
}

/* =========================================
   VALENTINE'S ARCADE (LAUNCHER) STYLES
   ========================================= */

.arcade-body {
    background: #000;
    /* Behind the wallpaper */
    overflow: hidden;
    /* Prevent scrolling the launcher */
    height: 100vh;
}

.ios-wrapper {
    background-image: url('assets/images/ios-wallpaper.jpg');
    /* Need to ensure this exists or fallback */
    background: linear-gradient(160deg, #0f0c29, #302b63, #24243e);
    /* Fallback dark space gradient */
    background-size: cover;
    background-position: center;
    height: calc(100vh - var(--header-height));
    /* Subtract header */
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
}

/* Status Bar */
.ios-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 10px;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.app-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.app-icon-wrapper:active {
    transform: scale(0.9);
    opacity: 0.8;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    /* iOS Squircle approximation */
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.app-name {
    color: white;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

/* Dock */
.ios-dock {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    /* Distribute evenly */
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 10px;
}

/* App Overlay (The Running Game) */
.app-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    /* Above everything */
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-overlay.hidden {
    display: none;
}

.app-content {
    flex: 1;
    overflow: auto;
    background: #f5f5f7;
}

.home-indicator-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 5px;
    background: #000;
    border-radius: 10px;
    border: none;
    opacity: 0.3;
    z-index: 2001;
    cursor: pointer;
}

.home-indicator-btn:hover {
    opacity: 0.8;
    height: 8px;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   MESSAGE APP STYLES
   ========================================= */
.message-app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.msg-header {
    height: 50px;
    border-bottom: 1px solid #e5e5e5;
    background: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 20px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-avatar {
    width: 30px;
    height: 30px;
    background: #999;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 2px;
}

.contact-name {
    font-size: 12px;
    font-weight: 500;
}

.msg-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-divider {
    text-align: center;
    color: #8e8e93;
    font-size: 11px;
    margin: 10px 0;
    font-weight: 500;
}

.msg-row {
    display: flex;
    align-items: flex-end;
    margin-bottom: 5px;
}

.msg-row.sent {
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.4;
    position: relative;
}

.msg-bubble.received {
    background: #e9e9eb;
    color: #000;
    border-bottom-left-radius: 4px;
}

.msg-bubble.sent {
    background: #007aff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.small-avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #ccc;
    margin-right: 8px;
}

.msg-input-area {
    height: 60px;
    border-top: 1px solid #c6c6c8;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.input-field {
    flex: 1;
    height: 34px;
    border: 1px solid #c6c6c8;
    border-radius: 17px;
    padding: 0 15px;
    background: #fff;
    line-height: 32px;
    color: #ccc;
    font-size: 15px;
    margin: 0 10px;
}

.camera-icon,
.mic-icon {
    font-size: 24px;
    color: #8e8e93;
    cursor: pointer;
}

/* =========================================
   PHOTO SLIDER STYLES
   ========================================= */
.photo-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #222;
    color: white;
}

/* =========================================
   VALENTINE'S PUZZLE GAME STYLES
   ========================================= */
.puzzle-header {
    text-align: center;
    margin-bottom: 20px;
}

.puzzle-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 320px;
    /* Specific width */
    height: 320px;
    background: #444;
    border: 4px solid #fff;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.puzzle-tile {
    width: 100%;
    height: 100%;
    /* auto from grid */
    background-color: #ddd;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.puzzle-tile.empty {
    background: transparent;
    cursor: default;
}

.puzzle-tile:not(.empty):hover {
    filter: brightness(1.1);
}

.tile-number {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px black;
}

.puzzle-controls {
    margin-top: 30px;
}
