/**
 * Hitparade Page Styles
 * Ella Radio Theme
 */

/* ==============================================
   PAGE HEADER (wie Programm-Seite)
============================================== */
.hitparade-header {
    padding: 2rem 0 3rem;
    margin-bottom: 0;
}

.hitparade-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #E30917, #C10713);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-align: left;
}

.hitparade-description {
    color: #666;
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 100%;
    text-align: left;
}

/* Desktop: Größere Überschrift */
@media (min-width: 768px) {
    .hitparade-title {
        font-size: 3rem;
    }
}

/* ==============================================
   VOTING STATUS
============================================== */
.voting-status {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.voting-status.success {
    border-color: #28a745;
    border-width: 3px;
    background: linear-gradient(135deg, #f1f8f4, #e8f5e9);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.2);
}

.voting-status.success::before {
    content: '✓';
    display: inline-block;
    width: 48px;
    height: 48px;
    background: #28a745;
    color: #ffffff;
    border-radius: 50%;
    line-height: 48px;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.voting-status.error {
    border-color: #E30917;
    background: #fef2f2;
}

.voting-status p {
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
}

/* ==============================================
   SONGS GRID
============================================== */
.songs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Song Card */
.song-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.song-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #E30917;
}

.song-card.selected {
    border-color: #E30917;
    border-width: 3px;
    box-shadow: 0 8px 20px rgba(227, 9, 23, 0.3);
}

/* Voted Song - Grüner Rahmen nach erfolgreichem Vote */
.song-card.voted {
    border-color: #28a745;
    border-width: 3px;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
    position: relative;
}

.song-card.voted::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #28a745;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
    z-index: 3;
}

/* Song Radio Input */
.song-card input[type="radio"] {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 2;
    accent-color: #E30917;
}

/* Song Rank Badge */
.song-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #E30917, #C10713);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(227, 9, 23, 0.3);
    z-index: 1;
}

/* Song Cover */
.song-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.song-cover-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 3rem;
}

/* Song Info */
.song-info {
    padding: 1rem;
    text-align: center;
}

.song-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.song-artist {
    font-size: 0.8125rem;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==============================================
   VOTE BUTTON
============================================== */
.vote-button-container {
    text-align: center;
    padding: 2rem 0;
}

.vote-button {
    background: linear-gradient(135deg, #E30917, #C10713);
    color: #ffffff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(227, 9, 23, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vote-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(227, 9, 23, 0.4);
}

.vote-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-button svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ==============================================
   ALREADY VOTED STATE
============================================== */
.hitparade-content.already-voted .song-card {
    opacity: 0.7;
    cursor: default;
}

/* Der gevotete Song bleibt voll sichtbar */
.hitparade-content.already-voted .song-card.voted {
    opacity: 1;
}

.hitparade-content.already-voted .song-card input[type="radio"] {
    display: none;
}

.hitparade-content.already-voted .vote-button-container {
    display: none;
}

/* WICHTIG: Die Erfolgsmeldung MUSS sichtbar bleiben */
.hitparade-content.already-voted .voting-status,
.voting-status.success,
.voting-status.error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==============================================
   LOADING STATE
============================================== */
.voting-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.voting-loading.active {
    display: flex;
}

.voting-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #E30917;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Desktop: 4 Spalten */
@media (max-width: 1200px) {
    .songs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet: 3 Spalten */
@media (max-width: 992px) {
    .songs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Portrait / Mobile */
@media (max-width: 768px) {
    .hitparade-header {
        padding: 1.5rem 0 2rem;
    }
    
    .hitparade-title {
        font-size: 2rem;
    }
    
    .hitparade-title {
        font-size: 2rem;
    }
    
    .songs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .song-info {
        padding: 0.75rem;
    }
    
    .song-title {
        font-size: 0.8125rem;
    }
    
    .song-artist {
        font-size: 0.75rem;
    }
    
    .vote-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .songs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .song-card input[type="radio"] {
        width: 18px;
        height: 18px;
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .song-rank {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        top: 0.375rem;
        right: 0.375rem;
    }
}

/* Song Vorschlag Section */
.song-vorschlag-section {
    padding: 3rem 0;
}

.song-vorschlag-box {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1), rgba(var(--color-secondary-rgb), 0.1));
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.song-vorschlag-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.song-vorschlag-description {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.song-vorschlag-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .song-vorschlag-fields {
        grid-template-columns: 1fr;
    }
}

.song-vorschlag-field {
    text-align: left;
}

.song-vorschlag-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.song-vorschlag-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.song-vorschlag-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.song-vorschlag-field input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.song-vorschlag-status {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.song-vorschlag-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.song-vorschlag-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.song-vorschlag-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.song-vorschlag-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.song-vorschlag-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.song-vorschlag-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: vorschlag-spin 0.8s linear infinite;
}

@keyframes vorschlag-spin {
    to { transform: rotate(360deg); }
}

/* Song Vorschlag - Light Theme Fix */
.song-vorschlag-box {
    background: linear-gradient(135deg, rgba(193, 109, 109, 0.08), rgba(193, 109, 109, 0.04));
    border: 1px solid rgba(193, 109, 109, 0.2);
}

.song-vorschlag-title {
    color: #1a1a1a;
}

.song-vorschlag-description {
    color: #666;
}

.song-vorschlag-field label {
    color: #333;
}

.song-vorschlag-field input {
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.song-vorschlag-field input:focus {
    border-color: var(--color-primary, #c16d6d);
    box-shadow: 0 0 0 3px rgba(193, 109, 109, 0.15);
}

.song-vorschlag-field input::placeholder {
    color: #999;
}

.song-vorschlag-submit {
    background: linear-gradient(135deg, #c16d6d, #a85858);
    box-shadow: 0 2px 8px rgba(193, 109, 109, 0.3);
}

.song-vorschlag-submit:hover {
    background: linear-gradient(135deg, #a85858, #8f4a4a);
    box-shadow: 0 4px 12px rgba(193, 109, 109, 0.4);
}

/* Song Vorschlag - Match Vote Button Style */
.song-vorschlag-section {
    padding: 2rem 0 3rem;
}

.song-vorschlag-box {
    max-width: 100%;
    background: transparent;
    border: none;
    padding: 2rem 0;
}

.song-vorschlag-form {
    max-width: 600px;
    margin: 0 auto;
}

.song-vorschlag-submit {
    background: linear-gradient(135deg, #E30917, #C10713);
    color: #ffffff;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(227, 9, 23, 0.3);
}

.song-vorschlag-submit:hover {
    background: linear-gradient(135deg, #E30917, #C10713);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(227, 9, 23, 0.4);
}

/* Song Vorschlag - Closer + Matching Title */
.song-vorschlag-section {
    padding: 1rem 0 2rem;
    margin-top: -1rem;
}

.song-vorschlag-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #E30917, #C10713);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.song-vorschlag-description {
    color: #666;
    margin-bottom: 1.25rem;
}

/* Song Vorschlag - Remove white space */
.song-vorschlag-section {
    padding: 0 0 2rem !important;
    margin-top: 0 !important;
}

.song-vorschlag-box {
    padding: 1.5rem 0 !important;
}

.vote-button-container {
    padding-bottom: 0;
    margin-bottom: 0;
}

.hitparade-voting-section {
    padding-bottom: 0;
}

/* Song Vorschlag - Mobile Fix */
@media (max-width: 768px) {
    .song-vorschlag-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .song-vorschlag-form {
        padding: 0 0.5rem;
    }
    
    .song-vorschlag-fields {
        gap: 0.75rem;
    }
    
    .song-vorschlag-field input {
        padding: 0.875rem 1rem;
    }
    
    .song-vorschlag-submit {
        width: 100%;
        justify-content: center;
    }
}

/* Song Vorschlag - Mobile Fix v2 - Use container padding */
@media (max-width: 768px) {
    .song-vorschlag-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .song-vorschlag-section.container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .song-vorschlag-form {
        padding: 0 !important;
    }
}

/* =============================================
   SONG VORSCHLAG - FINAL CLEAN STYLES
============================================== */
.song-vorschlag-section.container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.song-vorschlag-box {
    max-width: 600px !important;
    margin: 0 auto !important;
    padding: 1.5rem 0 !important;
    background: transparent !important;
    border: none !important;
}

.song-vorschlag-submit {
    padding: 1rem 3rem !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    width: auto !important;
}

@media (max-width: 768px) {
    .song-vorschlag-section.container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    .song-vorschlag-form {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .song-vorschlag-submit {
        width: auto !important;
        padding: 1rem 2rem !important;
    }
}

/* Song Vorschlag Button States */
.song-vorschlag-submit:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.song-vorschlag-submit:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(227, 9, 23, 0.4);
}

/* Song Vorschlag Button - Mobile Size Match */
@media (max-width: 768px) {
    .song-vorschlag-submit {
        padding: 0.875rem 2rem !important;
        font-size: 1rem !important;
    }
}
