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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-radius: 12px;
}

header h1 {
    font-size: 1.8rem;
    color: white;
}

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

.header-actions .btn {
    padding: 8px 16px;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
}

.header-actions .btn:hover {
    background: rgba(255,255,255,0.3);
}

.user-info {
    padding: 8px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

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

@media (max-width: 1000px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

.card {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.card h2 {
    margin-bottom: 15px;
    color: #ff6b6b;
    border-bottom: 2px solid #ff6b6b;
    padding-bottom: 10px;
}

.card h3 {
    margin: 15px 0 10px;
    color: #ddd;
    font-size: 1rem;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #16213e;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.login-box h1 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #888;
    font-weight: normal;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
}

.form-group input {
    width: 100%;
}

.btn-full {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

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

.account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #1a1a2e;
    border-radius: 6px;
    margin-bottom: 5px;
}

.account-item span:first-child {
    flex: 1;
}

.account-item.authenticated {
    border-left: 3px solid #27ae60;
}

.account-item.not-authenticated {
    border-left: 3px solid #e74c3c;
}

.auth-status {
    font-size: 1.2rem;
}

.add-account {
    display: flex;
    gap: 10px;
}

.add-account input {
    flex: 1;
}

.hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

.hint code {
    background: #0f3460;
    padding: 2px 6px;
    border-radius: 4px;
}

input, select, button, textarea {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

input, select, textarea {
    background: #0f3460;
    color: #fff;
    border: 1px solid #2a4a7a;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

input::placeholder, textarea::placeholder {
    color: #666;
}

button {
    background: #3498db;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #2980b9;
}

.btn-primary { background: #3498db; }
.btn-success { background: #27ae60; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; }
.btn-warning:hover { background: #d68910; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; }
.btn-large { padding: 15px 30px; font-size: 1.1rem; width: 100%; margin-top: 15px; }

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.form-row select, .form-row input {
    flex: 1;
    min-width: 150px;
}

.playlist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.playlist-column select {
    width: 100%;
    height: 150px;
    margin-bottom: 10px;
}

.playlist-column button {
    width: 100%;
}

.info-box {
    margin-top: 10px;
    padding: 10px;
    background: #0f3460;
    border-radius: 6px;
    font-size: 0.9rem;
    min-height: 40px;
}

.songs-section, .target-songs-section, .batch-section, .actions-section {
    grid-column: 1 / -1;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    min-width: 150px;
}

.search-bar select {
    min-width: 180px;
}

.pagination {
    margin-bottom: 10px;
    text-align: center;
}

.pagination button {
    margin: 0 10px;
}

.songs-table-container {
    max-height: 350px;
    overflow-y: auto;
    border-radius: 8px;
    background: #0f3460;
}

.songs-table {
    width: 100%;
    border-collapse: collapse;
}

.songs-table th,
.songs-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #1a1a2e;
}

.songs-table th {
    background: #16213e;
    position: sticky;
    top: 0;
    color: #ff6b6b;
}

.songs-table tr:hover {
    background: #1a2744;
}

.songs-table tr.unavailable {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.info-text {
    margin-top: 10px;
    color: #888;
    font-size: 0.9rem;
}

.action-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #0f3460;
    border-radius: 8px;
}

.action-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #ff6b6b;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.action-row input {
    flex: 1;
    min-width: 100px;
}

.action-row input[type="number"] {
    max-width: 100px;
    flex: 0;
}

.batch-section {
    background: #1a2744;
}

.batch-task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #0f3460;
    border-radius: 6px;
    margin-bottom: 8px;
}

.batch-add {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.batch-add select, .batch-add input {
    flex: 1;
    min-width: 120px;
}

.batch-add input[type="number"] {
    max-width: 100px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.modal-content pre {
    background: #0f3460;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.modal-content textarea {
    width: 100%;
    resize: vertical;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.admin-grid {
    max-width: 1000px;
    margin: 0 auto;
}

.add-user-form {
    background: #0f3460;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.add-user-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ddd;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #0f3460;
    border-radius: 8px;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #1a1a2e;
}

.users-table th {
    background: #16213e;
    color: #ff6b6b;
}

.status-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 8px;
    background: #16213e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
}

.status-bar.success { background: #27ae60; }
.status-bar.error { background: #e74c3c; }
.status-bar.info { background: #3498db; }

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.cookie-steps {
    text-align: left;
    margin: 15px 0;
}

.cookie-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 12px;
}

.step-number {
    background: #ff0000;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.code-box {
    background: #1e1e1e;
    color: #4EC9B0;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.code-box code {
    flex: 1;
}

.btn-copy {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #444;
    color: white;
}

.cookie-validation {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
}

.cookie-validation.valid {
    background: #1a3a1a;
    border: 1px solid #2d5a2d;
    color: #7ddf7d;
}

.cookie-validation.invalid {
    background: #3a1a1a;
    border: 1px solid #5a2d2d;
    color: #df7d7d;
}

.cookie-validation.partial {
    background: #3a3a1a;
    border: 1px solid #5a5a2d;
    color: #dfdf7d;
}

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

.btn-secondary:hover {
    background: #666;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
}

.auth-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
}

.auth-tab.active {
    color: white;
    border-bottom-color: #ff0000;
}

.oauth-code {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 5px;
    text-align: center;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 8px;
    color: #4EC9B0;
    font-family: monospace;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #333;
    border-top: 3px solid #4EC9B0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 15px auto;
}

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