* { box-sizing: border-box; }

body {
    background-color: #111;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Auth View Styles */
#auth-view {
    display: none;
    height: 100vh;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#auth-view.active { display: flex; }

.auth-box { max-width: 600px; }

h1, h2, h3 { color: #e5a00d; }

#pin-display {
    font-size: 5rem;
    font-weight: bold;
    letter-spacing: 8px;
    margin: 20px 0;
}

.inst {
    font-size: 1.8rem;
    color: #aaa;
    margin-bottom: 40px;
}

.tesla-btn {
    background-color: #222;
    color: #e5a00d;
    border: 2px solid #333;
    padding: 20px 40px;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tesla-btn:active {
    background-color: #e5a00d;
    color: #111;
}

/* App Layout Styles */
#app-container {
    display: none;
    grid-template-areas: 
        "content menu"
        "player player";
    grid-template-columns: 1fr 280px;
    grid-template-rows: 1fr 140px;
    height: 100vh;
}

#app-container.active { display: grid; }

#main-content {
    grid-area: content;
    padding: 30px;
    overflow-y: auto;
    background-color: #181818;
}

.app-view {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.app-view.active { display: block; }

h2 {
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

/* Grids */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

.grid-item {
    background-color: #222;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.grid-item:active { background-color: #333; }

.grid-item .art {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #444;
    border-radius: 8px;
    margin-bottom: 15px;
    background-size: cover;
    background-position: center;
}

.grid-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item p { margin: 0; color: #aaa; font-size: 1.2rem; }

/* Lists & Settings */
.list-item {
    background-color: #222;
    padding: 25px;
    font-size: 1.8rem;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
}

.setting-group {
    background-color: #222;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.setting-group h3 { margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px; }
.setting-group p { font-size: 1.4rem; }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.tesla-select {
    background-color: #111;
    color: #fff;
    border: 1px solid #444;
    padding: 10px;
    font-size: 1.2rem;
    border-radius: 6px;
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

/* Side Menu */
#side-menu {
    grid-area: menu;
    background-color: #111;
    border-left: 2px solid #222;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-btn {
    background-color: transparent;
    color: #e5a00d;
    border: 2px solid #333;
    padding: 30px 20px;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.menu-btn.active {
    background-color: #e5a00d;
    color: #111;
    border-color: #e5a00d;
}

/* Bottom Player */
#bottom-player {
    grid-area: player;
    background-color: #111;
    border-top: 2px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.now-playing-info { display: flex; align-items: center; gap: 20px; flex: 1; }
.player-art { width: 100px; height: 100px; background-color: #333; border-radius: 8px; background-size: cover; }
.player-text h3 { margin: 0 0 5px 0; font-size: 2rem; }
.player-text p { margin: 0; color: #aaa; font-size: 1.4rem; }

.player-controls { display: flex; gap: 30px; flex: 1; justify-content: center; }
.control-btn { background-color: transparent; color: #e5a00d; border: none; font-size: 4.5rem; cursor: pointer; }
.control-btn:active { color: #fff; }
.player-spacer { flex: 1; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
