* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info span {
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-primary, .btn-secondary, .btn-admin, .btn-vote {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-admin {
    background: linear-gradient(135deg, var(--secondary-color), #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

main {
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 500px;
}

.song-info {
    text-align: center;
    margin-bottom: 2rem;
}

.song-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.song-info p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vote-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-vote {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    justify-content: center;
}

.btn-like {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-like:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-dislike {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-dislike:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.btn-vote:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.message {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    margin: auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    animation: slideDown 0.3s;
    position: relative;
}

.modal-large {
    max-width: 95%;
    max-height: 90vh;
}

#tab-votes-grid h3 {
    margin-bottom: 1rem;
}

#tab-votes-grid {
    max-height: calc(90vh - 200px);
    display: flex;
    flex-direction: column;
}

#votes-grid-container {
    flex: 1;
    min-height: 0;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.user-management-section {
    margin-bottom: 1rem;
}

.error-message {
    color: var(--danger-color);
    margin-bottom: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Votes Grid */
.votes-grid-wrapper {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.votes-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-color);
    font-size: 0.9rem;
}

.votes-grid-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
}

.votes-grid-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
    white-space: nowrap;
}

.votes-grid-table th:first-child,
.votes-grid-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.votes-grid-table thead th:first-child {
    background: var(--bg-secondary);
    z-index: 11;
}

.votes-grid-table th:nth-child(2),
.votes-grid-table td:nth-child(2) {
    position: sticky;
    left: 150px;
    z-index: 4;
    background: var(--bg-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.votes-grid-table thead th:nth-child(2) {
    background: var(--bg-secondary);
    z-index: 11;
}

.votes-grid-table th:nth-child(3),
.votes-grid-table td:nth-child(3) {
    position: sticky;
    left: 300px;
    z-index: 4;
    background: var(--bg-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.votes-grid-table thead th:nth-child(3) {
    background: var(--bg-secondary);
    z-index: 11;
}

.votes-grid-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.votes-grid-table tbody tr:hover {
    background: var(--bg-secondary);
}

.votes-grid-table tbody tr:hover td:first-child,
.votes-grid-table tbody tr:hover td:nth-child(2),
.votes-grid-table tbody tr:hover td:nth-child(3) {
    background: var(--bg-secondary);
}

.vote-cell {
    text-align: center;
    font-weight: 600;
}

.vote-cell.yes {
    color: var(--success-color);
}

.vote-cell.no {
    color: var(--danger-color);
}

.vote-cell.empty {
    color: var(--text-secondary);
    opacity: 0.5;
}

.vote-cell .watch-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    font-weight: normal;
}

.votes-grid-table a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.votes-grid-table a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    header h1 {
        font-size: 2rem;
    }

    .vote-buttons {
        flex-direction: column;
    }

    .btn-vote {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

