/* ============================================
   Admin Panel Styles - Dark Mode Only
   ============================================ */

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 28% 18%, rgba(34, 211, 238, 0.18), transparent 34%),
        radial-gradient(circle at 74% 10%, rgba(45, 212, 191, 0.14), transparent 32%),
        linear-gradient(135deg, #06111f 0%, #0b1524 100%);
    padding: 20px;
}

.login-box {
    background: rgba(12, 25, 42, 0.9);
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
}

.login-box .login-desc {
    text-align: center;
    color: #94a3b8;
    margin-bottom: 32px;
    font-size: 14px;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 13px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #334155;
    border-radius: 8px;
    font-size: 14px;
    background: #0f172a;
    color: #f1f5f9;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #22d3ee;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.form-input::placeholder {
    color: #64748b;
}

textarea.form-input {
    min-height: 60px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, #17c7df 0%, #22c6ae 100%);
    color: #03111d;
    box-shadow: 0 2px 10px rgba(34, 211, 238, 0.22);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(34, 211, 238, 0.28);
}

.btn-secondary {
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
    color: #e2e8f0;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.btn-success {
    background: linear-gradient(135deg, #2dd4bf 0%, #84cc16 100%);
    color: #03111d;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #17c7df 0%, #22c6ae 100%);
    color: #03111d;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 18px rgba(34, 211, 238, 0.24);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.32);
}

.error-message {
    color: #f87171;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 8px;
}

/* Dashboard Layout */
.admin-header {
    background: rgba(7, 17, 31, 0.9);
    border-bottom: 1px solid rgba(125, 211, 252, 0.14);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(18px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    height: 56px;
}

.header-content h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.user-info {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn {
    padding: 6px 12px;
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Tab Navigation */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(12, 25, 42, 0.86);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(34, 211, 238, 0.14);
    color: #8df2ff;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

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

/* Manager Card */
.manager-card {
    background: rgba(12, 25, 42, 0.84);
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
    gap: 12px;
}

.manager-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.manager-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #22d3ee;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
}

.stat-info {
    font-size: 12px;
    color: #64748b;
    margin-left: auto;
}

/* List Container */
.list-container {
    padding: 12px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.list-item:hover {
    background: #1e293b;
    border-color: rgba(34, 211, 238, 0.24);
}

/* Site Icon */
.list-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(34, 211, 238, 0.12);
    flex-shrink: 0;
    overflow: hidden;
}

.list-item-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.category-admin-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.category-icon-editor {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.category-icon-preview {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(45, 212, 191, 0.08));
    color: #f1f5f9;
    font-size: 34px;
    overflow: hidden;
}

.category-icon-preview img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.category-icon-tools {
    min-width: 0;
}

.category-icon-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.category-icon-preset {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.74);
    color: #f1f5f9;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.18s ease;
}

.category-icon-preset:hover {
    border-color: rgba(34, 211, 238, 0.38);
    background: rgba(34, 211, 238, 0.1);
}

.category-icon-preset.active {
    border-color: rgba(34, 211, 238, 0.58);
    background: rgba(34, 211, 238, 0.18);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.08);
}

.category-upload-row {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.category-upload-hint {
    color: #64748b;
    font-size: 12px;
}

.category-custom-icon {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    padding: 9px 10px;
    background: rgba(15, 23, 42, 0.42);
}

.category-custom-icon summary {
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.category-custom-icon .form-input {
    margin-top: 8px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-description {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    font-size: 11px;
    color: #64748b;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-icon-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

.site-icon-badge.saved,
.site-icon-badge.inline {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.26);
    color: #34d399;
}

.site-icon-badge.remote {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #60a5fa;
}

.site-icon-badge.auto,
.site-icon-badge.fallback {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

.site-icon-badge.default {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.28);
    color: #94a3b8;
}

.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Empty State */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 14px;
}

/* Dialog/Modal Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.dialog-container {
    background: #1e293b;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.2s ease;
}

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

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #334155;
}

.dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.dialog-close {
    background: #334155;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.dialog-close:hover {
    background: #dc2626;
    color: white;
}

.dialog-body {
    padding: 20px;
}

.dialog-message {
    color: #e2e8f0;
    margin: 0 0 12px 0;
    line-height: 1.5;
    font-size: 14px;
}

.dialog-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 12px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #334155;
}

.dialog-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
}

.cancel-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

.confirm-btn {
    background: linear-gradient(135deg, #17c7df 0%, #22c6ae 100%);
    color: #03111d;
    border: none;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.24);
}

.confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #1e293b;
    border-color: #22d3ee;
}

.search-result-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-artist {
    font-size: 11px;
    color: #94a3b8;
}

.search-result-lrc {
    font-size: 10px;
    color: #10b981;
    margin-top: 1px;
}

.search-result-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.preview-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.preview-btn:hover {
    background: #22d3ee;
    color: #03111d;
}

.preview-btn.playing {
    background: #22d3ee;
    color: #03111d;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.36); }
    50% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

/* Playlist Track Item */
.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.track-item:hover {
    background: #1e293b;
    border-color: #334155;
}

/* Track Cover */
.track-cover-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #17c7df 0%, #22c6ae 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-cover-placeholder {
    font-size: 18px;
    color: white;
}

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

.track-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
}

.track-url {
    font-size: 10px;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-lrc-badge {
    display: inline-block;
    font-size: 10px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.track-order-controls {
    display: inline-flex;
    gap: 4px;
}

.track-order-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.18s ease;
}

.track-order-btn:hover:not(:disabled) {
    border-color: #22d3ee;
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.1);
}

.track-order-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* LRC Settings */
.lrc-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    flex-wrap: wrap;
}

.lrc-settings label {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.lrc-settings select,
.lrc-settings input[type="color"] {
    padding: 4px 8px;
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    background: #0f172a;
    color: #f1f5f9;
}

.lrc-settings input[type="color"] {
    width: 32px;
    height: 28px;
    padding: 2px;
}

.lrc-preview {
    padding: 6px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: white;
    font-size: 12px;
}

/* Settings Page */
.settings-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.settings-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-row label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    min-width: 90px;
}

.settings-row .form-input {
    flex: 1;
    max-width: 350px;
}

/* Backup Section */
.backup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.backup-card {
    background: #0f172a;
    border: 2px dashed #334155;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.backup-card:hover {
    border-color: #22d3ee;
}

.backup-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 6px 0;
}

.backup-card p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 12px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        padding: 0 12px;
    }
    
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 10px;
    }
    
    .admin-main {
        padding: 12px;
    }
    
    .admin-tabs {
        border-radius: 8px;
    }
    
    .tab-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .manager-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .manager-actions {
        width: 100%;
    }
    
    .manager-actions .btn {
        flex: 1;
    }
    
    .list-item {
        flex-wrap: wrap;
    }
    
    .list-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .category-icon-editor {
        grid-template-columns: 1fr;
    }

    .category-icon-preview {
        width: 64px;
        height: 64px;
    }
    
    .backup-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .settings-row .form-input {
        max-width: 100%;
        width: 100%;
    }
}

/* APlayer in admin */
.admin-preview-player {
    margin-top: 12px;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
}
