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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #667eea;
}

.login-box p {
    margin-bottom: 30px;
    color: #666;
}

/* Main Dashboard */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #667eea;
    font-size: 2em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-wide {
    grid-column: 1;
}

.card-narrow {
    grid-column: 2;
}

@media (max-width: 768px) {
    .card-wide,
    .card-narrow {
        grid-column: 1;
    }
}

.card h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-vote {
    background: #f8f9fa;
    color: #333;
    padding: 10px 14px;
    font-size: 18px;
    border: 2px solid #dee2e6;
    margin-right: 8px;
    min-width: 50px;
    transition: none;
}

.btn-vote:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-vote-active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-vote-active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.btn-pin {
    background: #ffc107;
    color: #333;
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 10px;
}

.btn-pin:hover {
    background: #e0a800;
}

.btn-pinned {
    background: #ff9800;
    color: white;
}

/* Songs List */
.songs-list {
    max-height: 500px;
    overflow-y: auto;
}

.song-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.song-item.pinned {
    border-left-color: #ffc107;
    background: #fff9e6;
}

/* Simplified song item for top songs */
.song-item-simple {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

.song-item-simple.pinned {
    border-left-color: #ffc107;
    background: #fff9e6;
}

.song-title-simple {
    font-weight: 600;
    font-size: 1em;
    color: #333;
    margin-bottom: 6px;
}

.song-meta-simple {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 6px;
}

.vote-count-simple {
    color: #555;
}

.song-link-simple {
    margin-top: 6px;
}

.song-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.song-title {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    flex: 1;
}

.song-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.song-meta span {
    margin-right: 15px;
}

.vote-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 6px;
}

.vote-stat {
    font-size: 0.95em;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
}

.vote-stat.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.song-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vote-count {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

.youtube-link {
    color: #dc3545;
    text-decoration: none;
    font-size: 0.9em;
}

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

/* Comments */
.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.comments-header {
    margin-bottom: 10px;
    color: #555;
    font-size: 0.95em;
}

.comments-list {
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.comment-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85em;
}

.comment-author {
    font-weight: 600;
    color: #667eea;
}

.comment-date {
    color: #999;
    font-size: 0.9em;
}

.comment-text {
    color: #333;
    font-size: 0.9em;
    line-height: 1.4;
}

.no-comments {
    color: #999;
    font-size: 0.9em;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.add-comment {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.comment-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    align-self: flex-end;
}

/* Messages */
.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: none;
}

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

.loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
}

.pin-badge {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 10px;
}

/* Scrollbar */
.songs-list::-webkit-scrollbar {
    width: 8px;
}

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

.songs-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.songs-list::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Dialog/Modal */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.dialog-overlay.show {
    display: flex;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dialog-header h2 {
    margin: 0;
    color: #667eea;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.dialog-close:hover {
    background: #f0f0f0;
    color: #333;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

