/*
Theme Name: GDrive Music PWA
Theme URI: 
Author: Jules
Author URI: 
Description: A PWA theme for the GDrive Music plugin, functioning as a standalone audio player.
Version: 1.0.0
*/

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    overscroll-behavior: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    padding: 15px 20px;
    font-size: 24px;
    font-weight: bold;
    border-bottom: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sync-btn {
    background: #1db954;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 14px;
    cursor: pointer;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 90px; /* Space for mini player */
}

/* Auth View */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.auth-container input {
    width: 80%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #333;
    background: #282828;
    color: white;
}
.auth-container button {
    width: 80%;
    padding: 12px;
    margin-top: 10px;
    border-radius: 8px;
    background: #1db954;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

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

.card {
    background: #181818;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: background 0.3s ease;
    cursor: pointer;
}

.card:hover {
    background: #282828;
}

.card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #282828;
}

.card .title {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card .subtitle {
    font-size: 12px;
    color: #b3b3b3;
    margin-top: 5px;
}

/* List Items (Tracks) */
.list-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #282828;
}
.list-item:active { background: #282828; }
.list-item .info { flex: 1; margin-left: 15px; overflow: hidden; }
.list-item .title { font-size: 16px; margin-bottom: 4px; }
.list-item .artist { font-size: 14px; color: #b3b3b3; }
.list-item .actions button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    padding: 10px;
}
.downloaded-icon { color: #1db954; font-size: 12px; margin-left: 5px;}

/* Mini Player */
#mini-player {
    position: fixed;
    bottom: 60px; /* Above nav */
    left: 0;
    right: 0;
    background: #282828;
    border-radius: 8px;
    margin: 0 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    z-index: 100;
}
#mini-player img { width: 40px; height: 40px; border-radius: 4px; }
#mini-player .info { flex: 1; margin: 0 10px; overflow: hidden;}
#mini-player .title { font-size: 14px; font-weight: bold; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
#mini-player .artist { font-size: 12px; color: #b3b3b3; }
#mini-player .controls button { background: none; border: none; color: white; font-size: 24px; margin: 0 5px; cursor: pointer; }

/* Bottom Nav */
nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 20px 0; /* extra padding for iOS home indicator */
    border-top: 1px solid #282828;
    z-index: 90;
}
nav button {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
nav button.active { color: white; }
nav button i { font-size: 20px; margin-bottom: 4px; }

/* Full Player Modal */
#full-player {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    bottom: 0;
    background: #121212;
    z-index: 200;
    transition: top 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
#full-player.active { top: 0; }
.fp-header { display: flex; justify-content: space-between; align-items: center; font-size: 20px; margin-bottom: 30px;}
.fp-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);}
.fp-info .title { font-size: 24px; font-weight: bold; margin-bottom: 5px; }
.fp-info .artist { font-size: 18px; color: #b3b3b3; margin-bottom: 20px; }
.fp-progress { display: flex; align-items: center; font-size: 12px; color: #b3b3b3; margin-bottom: 30px;}
.fp-progress input[type="range"] { flex: 1; margin: 0 10px; accent-color: white;}
.fp-controls { display: flex; justify-content: space-between; align-items: center; font-size: 32px;}
.fp-controls .play-btn { font-size: 64px; }
