:root {
    --primary: #8a2be2;
    --secondary: #00f2ff;
    --bg: #050505;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --accent-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: --primary 0.8s ease, --secondary 0.8s ease;
}

/* Header & Search */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.search-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    display: flex;
    align-items: center;
    padding: 0.2rem 1rem;
    transition: 0.3s;
}

.search-container:focus-within {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.15);
}

.search-container input {
    background: none;
    border: none;
    color: white;
    padding: 0.8rem;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
}

.search-container svg {
    width: 20px;
    height: 20px;
    fill: var(--text-dim);
}

body {
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    height: 100%;
    width: 100%;
    position: relative;
}

/* Feed Container */
.feed-container {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.feed-item {
    height: 100%;
    width: 100%;
    scroll-snap-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    background-size: 110%;
    /* Larger for parallax */
    background-position: center;
    transition: background-position 0.1s ease-out;
}

.weather-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 1s ease;
}

.weather-rain {
    background: url('https://raw.githubusercontent.com/MartaFonda/RainyDay.js/master/demo/img/drop-color.png');
    opacity: 0.2;
    mix-blend-mode: screen;
}

.feed-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.wallpaper-info {
    position: relative;
    z-index: 2;
    margin-bottom: 5rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.wallpaper-info h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.vibe-pill {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* UI Elements */
.magic-button {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.4);
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-button:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.6);
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.magic-button svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 10px;
    z-index: 90;
    border-top: 1px solid var(--glass-border);
}

.nav-item {
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    transition: 0.3s;
}

.nav-item.active {
    color: var(--text);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* Bento Grid View */
.bento-view {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    padding: 2rem;
    overflow-y: auto;
    display: none;
}

.bento-view.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.bento-header {
    margin-bottom: 2rem;
}

.bento-header h1 {
    font-size: 2rem;
    font-weight: 800;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    gap: 1rem;
}

.bento-card {
    border-radius: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.bento-card:nth-child(3n) {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-card:hover {
    border-color: var(--secondary);
    transform: translateY(-5px);
}

/* Lockout Overlay */
.lockout-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.premium-card {
    background: var(--glass);
    border: 1px solid var(--secondary);
    padding: 3rem 2rem;
    border-radius: 40px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.lock-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#ai-prompt {
    width: 100%;
    height: 150px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: white;
    padding: 1rem;
    font-size: 1rem;
    outline: none;
    resize: none;
    margin-bottom: 1rem;
}

.icon-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

/* Profile / Auth Styles */
.auth-container {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 30px;
    text-align: center;
    width: 100%;
    max-width: 350px;
    animation: fadeInUp 0.8s ease;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.google-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    background: white;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.google-btn:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
}

.google-btn svg {
    width: 20px;
    height: 20px;
    fill: #4285F4;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--glass);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-size: cover;
    border: 3px solid var(--secondary);
}

.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Utility */
.hidden {
    display: none;
}

.apply-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(40px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.apply-modal.active {
    display: flex;
}

.preview-container {
    width: 300px;
    height: 600px;
    /* ~9:18 aspect ratio */
    border-radius: 40px;
    border: 12px solid #1a1a1a;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    background: #000;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.preview-clock {
    position: absolute;
    top: 15%;
    /* Lower it slightly */
    width: 100%;
    text-align: center;
    font-size: 4.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    font-family: 'Inter', sans-serif;
    letter-spacing: -2px;
}

.preview-date {
    position: absolute;
    top: 12%;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 100px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-secondary {
    background: var(--glass);
    color: white;
    border: 1px solid var(--glass-border);
}