:root {
    /* --- Player Base --- */
    --plyr-main-color: #00b3b3;
    --plyr-bg-color: #ffffff;
    --plyr-control-icon-color: #333333;
    --plyr-volume-handle-color: #00b3b3;
    --plyr-audio-controls-background: #ffffff; 

    /* --- Borders --- */
    --plyr-border-radius: 10px;
    --plyr-border-size: 1px;
    --plyr-border-color: #cccccc;
    --plyr-border-style: solid;

    /* --- Playlist Colors --- */
    --playlist-bg-color: #ffffff;
    --playlist-font-color: #333333;
    --playlist-hover-bg-color: #f0f0f0; 
    --playlist-hover-font-color: #333333; 
    --playlist-active-bg-color: var(--plyr-main-color);
    --playlist-active-font-color: #ffffff;
    --meta-link-color: #008f8f;
    
    /* --- Track Info Colors --- */
    --track-info-bg-color: #f8f8f8;
    --track-name-font-color: #333333;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: 350px;
    padding: 20px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
    position: fixed; 
    height: 100vh; 
    overflow-y: auto; 
}

#sidebar h1 {
    color: var(--plyr-main-color);
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.section {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.section h3 {
    background-color: #f8f8f8;
    padding: 10px;
    margin: 0;
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
}

.track-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f0f0f0;
    cursor: pointer;
}

.track-name-display {
    font-weight: bold;
    flex-grow: 1;
}

.remove-track-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 10px;
}

.track-details {
    padding: 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background-color: #fff;
}

.track-details.open {
    max-height: 1000px; 
    padding: 10px;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

#style-details {
    padding: 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background-color: #fff;
}

#style-details.open {
    max-height: 1500px;
    padding: 10px;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

#style-details h4 {
    color: #555;
    margin: 15px 0 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px dashed #ccc;
    font-size: 1em;
}

/* New layout for stacking labels and inputs/fields */
.field-group {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column; /* Stack vertically */
    align-items: flex-start; /* Align contents to the left */
}

/* Labels should take full width in the column layout */
.field-group label {
    width: 100%;
    margin-right: 0; 
    margin-bottom: 5px; /* Add space between label and field */
    font-size: 0.9em;
}

/* Make all text/url/textarea fields full width */
.field-group input[type="text"],
.field-group input[type="url"],
.field-group textarea,
.track-details .field-group select { 
    width: 100%; 
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1em;
}

/* Special wrapper for color/select/inline fields */
.inline-input {
    display: flex;
    justify-content: flex-end; /* Push input/select to the right */
    align-items: center;
    width: 100%;
}

.field-group input[type="color"],
.inline-input select {
    width: 60px;
    height: 30px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0; 
}

/* Slider group */
.slider-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.slider-group input[type="range"] {
    width: 100%;
    margin-left: 0;
    margin-top: 0;
}

.action-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.generate-btn {
    background-color: #3498db;
}

.generate-btn:hover {
    background-color: #2980b9;
}

.export-btn {
    background-color: #2ecc71;
}

.export-btn:hover {
    background-color: #27ae60;
}

.export-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#preview-area {
    flex-grow: 1;
    padding: 20px;
    background-color: #fff;
    position: relative;
    margin-left: 350px; 
}

#preview-area h2 {
    color: #555;
    margin-top: 0;
    font-size: 1.3em;
}

#preview-message {
    text-align: center;
    padding: 50px;
    color: #999;
}

/* Player Structure Styling */
#player-container {
    padding: 20px;
    min-height: 250px;
}

.player-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--plyr-bg-color, white);
    padding: 10px;
    border: var(--plyr-border-size) var(--plyr-border-style) var(--plyr-border-color);
    border-radius: var(--plyr-border-radius);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Plyr Overrides */
.plyr--audio {
    --plyr-color-main: var(--plyr-main-color);
    --plyr-control-spacing: 5px;
    --plyr-range-thumb-background: var(--plyr-volume-handle-color);
    border-radius: var(--plyr-border-radius); 
}

.plyr--audio .plyr__controls {
    background: var(--plyr-audio-controls-background); 
}

.plyr--audio .plyr__controls button svg, 
.plyr--audio .plyr__controls a svg {
    fill: var(--plyr-control-icon-color);
}


/* Custom Track Info Bar */
#track-info {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 5px 10px;
    background: var(--track-info-bg-color);
    border-radius: var(--plyr-border-radius);
}

#current-art {
    width: 50px; 
    height: 50px; 
    border-radius: 5px; 
    margin-right: 10px;
    object-fit: cover;
}

#current-track-name { 
    flex-grow: 1; 
    font-weight: bold; 
    margin-left: 10px; 
    color: var(--track-name-font-color);
}

/* Custom Playlist Styling */
#custom-playlist {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: var(--plyr-border-radius);
    overflow: hidden;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    
    background-color: var(--playlist-bg-color);
    color: var(--playlist-font-color);
    transition: background-color 0.1s;
}

.playlist-item:hover:not(.active) {
    background-color: var(--playlist-hover-bg-color); 
    color: var(--playlist-hover-font-color); 
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item.active {
    background-color: var(--playlist-active-bg-color);
    color: var(--playlist-active-font-color);
}

.playlist-meta a {
    color: var(--meta-link-color);
    margin-left: 15px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    position: relative;
    display: inline-block;
}

.playlist-item.active .playlist-meta a {
    color: var(--playlist-active-font-color);
    opacity: 0.8;
}

/* Tooltip for Lyrics/Credits */
.tooltip-window {
    position: absolute; 
    background-color: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s;
    display: block;
	top: 0;
	right: 0;
}

.tooltip-window.visible {
    opacity: 1;
    display: block;
}

#tooltip-content {
    white-space: pre-wrap;
}

/* Preview Background Toggle Button */
#bg-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background-color: #7f8c8d;
    color: white;
    padding: 5px 10px;
    font-size: 0.8em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#bg-toggle-btn:hover {
    background-color: #5d6d7e;
}