/* Airplay Charts Styling */

.airplay-charts-container {
    margin: 20px 0;
    padding: 20px;
    position: relative;
}

.airplay-charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.airplay-charts-container h2 {
    font-size: 24px;
    margin: 0;
    color: #333;
}

.airplay-charts-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.airplay-charts-selector label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.chart-week-dropdown {
    padding: 8px 12px;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
}

.chart-week-dropdown:hover {
    border-color: #3498db;
}

.chart-week-dropdown:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.airplay-charts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.airplay-charts-table thead {
    background: #2c3e50;
    color: #fff;
}

.airplay-charts-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Sortierbare Spalten */
.airplay-charts-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
    transition: background-color 0.2s;
}

.airplay-charts-table th.sortable:hover {
    background-color: #1a2a3a;
}

.airplay-charts-table th.sortable .sort-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: 0.3;
}

.airplay-charts-table th.sortable .sort-icon::before {
    content: '';
    position: absolute;
    right: -5px;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid #fff;
}

.airplay-charts-table th.sortable .sort-icon::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 2px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
}

.airplay-charts-table th.sorted-asc .sort-icon::before {
    opacity: 1;
    border-bottom-color: #3498db;
}

.airplay-charts-table th.sorted-asc .sort-icon::after {
    opacity: 0.3;
}

.airplay-charts-table th.sorted-desc .sort-icon::before {
    opacity: 0.3;
}

.airplay-charts-table th.sorted-desc .sort-icon::after {
    opacity: 1;
    border-top-color: #3498db;
}

.airplay-charts-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.airplay-charts-table tbody tr:hover {
    background-color: #f5f5f5;
}

.airplay-charts-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

.airplay-charts-table tbody tr:nth-child(odd):hover {
    background-color: #f0f0f0;
}

.airplay-charts-table td {
    padding: 12px 15px;
    color: #555;
}

.airplay-charts-table td.position {
    font-weight: bold;
    color: #2c3e50;
    width: 60px;
    text-align: center;
    font-size: 16px;
}

.airplay-charts-table td.trend {
    text-align: center !important;
    font-weight: 600;
    width: 80px;
    font-size: 14px;
    vertical-align: middle;
}

.airplay-charts-table td.trend .trend-up {
    color: #27ae60 !important;
    display: inline-block;
    font-weight: 600;
}

.airplay-charts-table td.trend .trend-down {
    color: #e74c3c !important;
    display: inline-block;
    font-weight: 600;
}

.airplay-charts-table td.trend .trend-same {
    color: #95a5a6 !important;
    display: inline-block;
}

.airplay-charts-table td.trend .trend-new {
    color: #3498db !important;
    font-weight: 700;
    display: inline-block;
    font-size: 12px;
}

.airplay-charts-table td.trend .trend-none {
    color: #bdc3c7 !important;
    display: inline-block;
}

.airplay-charts-table .artist {
    font-weight: 600;
    color: #34495e;
    width: 25%;
}

.airplay-charts-table .title {
    color: #666;
    width: 35%;
}

.airplay-charts-table .year {
    text-align: center;
    color: #999;
    width: 50px;
}

.airplay-charts-table .total-weeks {
    text-align: center;
    font-weight: 600;
    color: #2271b1;
    width: 60px;
}

.airplay-charts-table .current-streak {
    text-align: center;
    font-weight: 600;
    width: 65px;
}

.airplay-charts-table .plays {
    text-align: center;
    font-weight: 500;
    color: #3498db;
    width: 80px;
}

/* Audio Player Styles */
.chart-play-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chart-play-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.1);
}

.chart-play-btn.playing {
    background-color: rgba(52, 152, 219, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(52, 152, 219, 0);
    }
}

/* Copy Button Styles */
.chart-copy-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.chart-copy-btn:hover {
    background-color: rgba(46, 204, 113, 0.15);
    transform: scale(1.15);
    opacity: 1;
}

.chart-copy-btn:active {
    transform: scale(0.9);
}

.chart-copy-btn.copied {
    background-color: rgba(46, 204, 113, 0.3);
    animation: copySuccess 0.5s ease-out;
}

@keyframes copySuccess {
    0% {
        background-color: rgba(46, 204, 113, 0.5);
        transform: scale(1.2);
    }
    100% {
        background-color: rgba(46, 204, 113, 0.3);
        transform: scale(1);
    }
}

/* Admin Button Styles (nur für eingeloggte Admins) */
.chart-admin-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.chart-admin-btn:hover {
    background-color: rgba(52, 152, 219, 0.15);
    transform: scale(1.15);
    opacity: 1;
}

.chart-admin-btn:active {
    transform: scale(0.9);
}

/* NEUER Mini-Player - Professionell */
#airplay-mini-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    min-width: 400px;
    max-width: 500px;
    animation: slideIn 0.3s ease-out;
}

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

.mini-player-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.now-playing-icon {
    font-size: 24px;
    /* Animation entfernt - kein HÃ¼pfen mehr */
}

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

.track-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #fff;
}

.track-artist {
    font-size: 13px;
    opacity: 0.85;
    color: #ecf0f1;
}

/* Progress Bar */
.player-progress {
    margin: 15px 0;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin: 8px 0;
}

.progress-bar-container:hover {
    height: 8px;
    margin: 7px 0;
}

.progress-bar {
    height: 100%;
    background: #3498db;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #3498db;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar::after {
    opacity: 1;
}

.player-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.75;
    font-family: 'Courier New', monospace;
}

/* Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.player-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: 600;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.player-btn:active {
    transform: scale(0.95);
}

.player-btn-primary {
    width: 44px;
    height: 44px;
    font-size: 18px;
    background: rgba(52, 152, 219, 0.8);
}

.player-btn-primary:hover {
    background: rgba(52, 152, 219, 1);
}

.player-btn-stop {
    background: rgba(231, 76, 60, 0.6);
}

.player-btn-stop:hover {
    background: rgba(231, 76, 60, 0.8);
}

/* Skip Button Labels */
.player-btn-skip {
    position: relative;
}

.player-btn-skip::after {
    content: attr(data-skip);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    opacity: 0.6;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .airplay-charts-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .airplay-charts-selector {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-week-dropdown {
        width: 100%;
    }
    
    .airplay-charts-table {
        font-size: 14px;
    }
    
    .airplay-charts-table th,
    .airplay-charts-table td {
        padding: 8px 10px;
    }
    
    .airplay-charts-table .position {
        width: 40px;
        font-size: 14px;
    }
    
    .airplay-charts-table .artist,
    .airplay-charts-table .title {
        width: auto;
    }
    
    #airplay-mini-player {
        left: 10px;
        right: 10px;
        bottom: 10px;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .airplay-charts-table {
        display: block;
        overflow-x: auto;
    }
    
    .airplay-charts-table thead {
        display: none;
    }
    
    .airplay-charts-table tbody,
    .airplay-charts-table tr,
    .airplay-charts-table td {
        display: block;
        width: 100%;
    }
    
    .airplay-charts-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }
    
    .airplay-charts-table td {
        padding: 5px 10px;
        border: none;
        position: relative;
        padding-left: 40%;
    }
    
    .airplay-charts-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 11px;
        color: #999;
    }
    
    .airplay-charts-table .position {
        text-align: left;
    }
    
    .player-controls {
        flex-wrap: wrap;
    }
}

/* MP3-Verwaltungs-Modal (nur für Admins) */
.airplay-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.airplay-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.airplay-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.airplay-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.airplay-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.airplay-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.airplay-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.airplay-modal-body {
    padding: 25px;
}

.song-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #2c3e50;
    border-left: 4px solid #3498db;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.help-text {
    margin-top: 10px;
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.6;
}

.current-mp3-info {
    background: #e7f5e7;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #27ae60;
    font-size: 14px;
}

.mp3-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.mp3-link:hover {
    text-decoration: underline;
}

.modal-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 500;
}

.modal-message.success {
    background: #d5f4e6;
    color: #00a32a;
    border-left: 4px solid #00a32a;
}

.modal-message.error {
    background: #f8d7da;
    color: #d63638;
    border-left: 4px solid #d63638;
}

.airplay-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn-primary {
    background: #3498db;
    color: white;
}

.modal-btn-primary:hover {
    background: #2980b9;
}

.modal-btn-danger {
    background: #e74c3c;
    color: white;
}

.modal-btn-danger:hover {
    background: #c0392b;
}

.modal-btn-secondary {
    background: #95a5a6;
    color: white;
}

.modal-btn-secondary:hover {
    background: #7f8c8d;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .airplay-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .airplay-modal-header,
    .airplay-modal-body,
    .airplay-modal-footer {
        padding: 15px;
    }

    .airplay-modal-footer {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}
