/* Audio Player MVP v1.1.0 - New Layout Design */

/* ============================================
   MAIN WRAPPER
   ============================================ */
.apm-player-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================
   THREE-COLUMN GRID LAYOUT
   ============================================ */
.apm-main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.apm-column {
    background: #32CD32; /* Lime green from sketch */
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

/* ============================================
   LEFT COLUMN - Logo & Now Playing
   ============================================ */
.apm-column-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.apm-logo-box {
    background: #E08A00; /* Orange from sketch */
    border-radius: 6px;
    padding: 30px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apm-logo-image {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.apm-logo-placeholder {
    color: #333;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.apm-now-playing-box {
    background: #E08A00; /* Orange from sketch */
    border-radius: 6px;
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apm-track-name {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    display: block;
    word-wrap: break-word;
}

.apm-track-time {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    display: block;
}

.apm-current-time,
.apm-duration {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   CENTER COLUMN - Playlist
   ============================================ */
.apm-column-center {
    display: flex;
    flex-direction: column;
}

.apm-playlist-box {
    background: #E08A00; /* Orange from sketch */
    border-radius: 6px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.apm-playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.apm-playlist-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.apm-track-count {
    font-size: 14px;
    color: #333;
    background: rgba(0,0,0,0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.apm-track-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.apm-track-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.apm-track-item:hover {
    background: rgba(255,255,255,0.3);
}

.apm-track-item.active {
    background: rgba(255,255,255,0.5);
    font-weight: 600;
}

.apm-track-item.active .apm-track-number {
    background: #32CD32;
    color: white;
}

.apm-track-number {
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-right: 12px;
    flex-shrink: 0;
}

.apm-track-title {
    flex: 1;
    color: #1a1a1a;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apm-track-format {
    background: rgba(0,0,0,0.15);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    margin-left: 10px;
}

.apm-no-files {
    text-align: center;
    padding: 40px 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.8;
}

.apm-no-files code {
    display: block;
    background: rgba(0,0,0,0.1);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 12px;
}

/* ============================================
   RIGHT COLUMN - Instructions
   ============================================ */
.apm-column-right {
    display: flex;
    flex-direction: column;
}

.apm-instructions-box {
    background: #E08A00; /* Orange from sketch */
    border-radius: 6px;
    padding: 25px;
    flex: 1;
}

.apm-instructions-headline {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.apm-instructions-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin: 0;
}

/* ============================================
   BOTTOM CONTROL BAR
   ============================================ */
.apm-control-bar {
    background: #EEEEEE; /* Gray from sketch */
    border-radius: 8px;
    padding: 20px 30px;
}

.apm-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

/* Control Buttons */
.apm-btn {
    background: #E65100; /* Deep orange for buttons */
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apm-btn:hover {
    background: #BF360C;
    transform: translateY(-1px);
}

.apm-btn.apm-play-pause {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    font-size: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apm-btn.active {
    background: #2E7D32; /* Green when active */
}

.apm-btn.active:hover {
    background: #1B5E20;
}

/* Volume Control */
.apm-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.apm-volume-icon {
    font-size: 18px;
}

.apm-volume-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ccc;
    border-radius: 3px;
    outline: none;
}

.apm-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #E65100;
    border-radius: 50%;
    cursor: pointer;
}

.apm-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #E65100;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Progress Bar / Timeline */
.apm-progress-container {
    width: 100%;
}

.apm-progress-bar {
    width: 100%;
    height: 8px;
    background: #E65100; /* Orange progress bar background */
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.apm-progress-filled {
    height: 100%;
    background: #BF360C; /* Darker orange for filled portion */
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.apm-progress-filled::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .apm-main-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .apm-column-left {
        grid-column: 1;
        grid-row: 1;
    }
    
    .apm-column-center {
        grid-column: 2;
        grid-row: 1 / 3;
    }
    
    .apm-column-right {
        grid-column: 1;
        grid-row: 2;
    }
    
    .apm-column {
        min-height: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .apm-player-wrapper {
        margin: 10px;
    }
    
    .apm-main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 10px;
    }
    
    .apm-column-left,
    .apm-column-center,
    .apm-column-right {
        grid-column: 1;
        grid-row: auto;
    }
    
    .apm-column {
        min-height: auto;
        padding: 15px;
    }
    
    .apm-column-left {
        order: 2;
    }
    
    .apm-column-center {
        order: 1;
    }
    
    .apm-column-right {
        order: 3;
    }
    
    .apm-logo-box {
        min-height: 120px;
        padding: 20px;
    }
    
    .apm-playlist-box {
        max-height: 350px;
    }
    
    .apm-track-list {
        max-height: 250px;
    }
    
    .apm-control-bar {
        padding: 15px;
    }
    
    .apm-controls-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .apm-btn {
        padding: 8px 14px;
        font-size: 11px;
    }
    
    .apm-btn.apm-play-pause {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .apm-volume-control {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .apm-track-name {
        font-size: 18px;
    }
    
    .apm-track-time {
        font-size: 22px;
    }
    
    .apm-instructions-headline {
        font-size: 20px;
    }
    
    .apm-instructions-text {
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .apm-controls-row {
        gap: 6px;
    }
    
    .apm-btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .apm-btn.apm-play-pause {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .apm-volume-slider {
        width: 80px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.apm-track-list::-webkit-scrollbar {
    width: 8px;
}

.apm-track-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.apm-track-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.apm-track-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

/* ============================================
   ACCESSIBILITY & STATES
   ============================================ */
.apm-btn:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.apm-track-item:focus {
    outline: 2px solid #333;
    outline-offset: -2px;
}

/* Playing animation */
.apm-track-item.active .apm-track-number::before {
    content: '♪';
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
