/* TOA Dashboard - Custom Styles */

/* General */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-size: 1.25rem;
}

.nav-link {
    padding: 0.5rem 1rem !important;
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
}

/* Cards */
.card {
    border-radius: 0.75rem;
    border: 1px solid rgba(0,0,0,.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.08) !important;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-top: none;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}

/* Badges */
.badge {
    font-size: 0.7rem;
    padding: 0.4em 0.6em;
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-group-sm > .btn {
    padding: 0.2rem 0.4rem;
}

/* Player Panel */
#player-panel .card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

#player-panel .card-header {
    background: rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#player-panel .btn {
    border-color: rgba(255,255,255,0.3);
    color: white;
}

#player-panel .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

#player-panel .btn-outline-secondary {
    border-color: rgba(255,255,255,0.5);
    color: white;
}

#player-panel .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.2);
}

#player-panel .progress {
    background: rgba(255,255,255,0.2);
}

#player-panel .progress-bar {
    background: white;
}

#player-panel .form-range::-webkit-slider-thumb {
    background: white;
}

#player-panel .form-range::-moz-range-thumb {
    background: white;
}

#player-panel .text-muted {
    color: rgba(255,255,255,0.7) !important;
}

/* Volume Slider */
#volume-slider, #large-volume-slider {
    height: 6px;
}

#volume-value, #large-volume-value {
    min-width: 45px;
    text-align: right;
}

/* Queue List */
#queue-list .list-group-item, #large-queue-list .list-group-item {
    background: rgba(255,255,255,0.05);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
}

#queue-list .list-group-item:last-child, #large-queue-list .list-group-item:last-child {
    border-bottom: none;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-meta {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Progress Bar */
.progress {
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.1s linear;
}

/* Stats Cards */
.card.text-white .card-body i {
    opacity: 0.3;
    transition: opacity 0.2s;
}

.card.text-white:hover .card-body i {
    opacity: 0.5;
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Login Page */
.min-vh-100 {
    min-height: 100vh;
}

.login-header {
    border-radius: 1rem 1rem 0 0 !important;
}

/* Toast Container */
.toast-container {
    z-index: 1080;
}

.toast {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 0 !important;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.15rem 0.3rem;
    }
    
    #player-panel .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    #player-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

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

.card {
    animation: fadeIn 0.3s ease;
}

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

.playing-indicator {
    animation: pulse 1s infinite;
}

/* Large Player Page */
#large-progress-container {
    max-width: 600px;
    margin: 0 auto;
}

#large-controls .btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#large-controls .btn-lg.px-5 {
    width: 80px;
    height: 80px;
}

/* Playlist Detail */
#playlist-items-table .position-cell {
    font-weight: 600;
    color: #6c757d;
}

#playlist-items-table tbody tr:hover .position-cell {
    color: #667eea;
}

/* Emergency Stop Button */
#emergency-stop {
    animation: pulse 2s infinite;
}

#emergency-stop:hover {
    animation: none;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Print */
@media print {
    .navbar, .btn, .card-header, footer, #player-panel {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .table {
        font-size: 0.75rem;
    }
}