:root {
    --bg: #0f172a;
    --card: #1e293b;
    --accent: #38bdf8;
    --text: #f8fafc;
    /* Respect iPhone Notch/Bottom Bar */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

main {
    padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 80px) 20px;
}

.page { display: none; }
.page.active { display: block; }

/* Grid for Movies */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.movie-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    font-size: 0.8rem;
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

/* Bottom Nav Styling */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-bottom));
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid #334155;
}

.nav-item {
    background: none;
    border: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.nav-item .icon { font-size: 1.5rem; margin-bottom: 2px; }

/* UI Elements */
input {
    width: 100%;
    padding: 12px;
    background: var(--card);
    border: 1px solid #334155;
    color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
}