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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f1117 0%, #161b22 100%);
    color: #c9d1d9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px;
}

.container {
    width: 100%;
    max-width: 440px;
}

/* Header */
.header {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.header h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #6c63ff;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
    letter-spacing: 0.5px;
}

.form-group input {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 12px;
    color: #c9d1d9;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.form-group input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.btn {
    background: #6c63ff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.btn:hover:not(:disabled) {
    background: #7d74ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #da3633;
}

.btn-danger:hover:not(:disabled) {
    background: #f85149;
}

.btn-secondary {
    background: #30363d;
    color: #c9d1d9;
}

.btn-secondary:hover:not(:disabled) {
    background: #3d444d;
}

.btn-success {
    background: #238636;
}

.btn-success:hover:not(:disabled) {
    background: #2ea043;
}

/* Main content */
.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.panel {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    height: 600px;
}

.panel.active {
    display: flex;
}

.panel-header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-footer {
    background: #161b22;
    border-top: 1px solid #30363d;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Lists */
.list-item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    background: #1c2128;
    border-color: #6c63ff;
}

.list-item.selected {
    background: rgba(108, 99, 255, 0.1);
    border-color: #6c63ff;
}

.list-item-info {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.list-item-meta {
    font-size: 12px;
    color: #8b949e;
}

.content-list-item {
    align-items: flex-start;
    gap: 16px;
}

.content-preview {
    margin-top: 10px;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
    background: #0d1117;
    max-width: 320px;
}

.content-preview img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: #0d1117;
}

.content-preview audio,
.content-preview video {
    display: block;
    width: 100%;
    background: #0d1117;
}

.content-preview-meta {
    margin-top: 6px;
    padding: 6px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 11px;
    color: #8b949e;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.content-preview-meta span b {
    color: #c9d1d9;
}

.content-preview-link {
    display: inline-block;
    margin-top: 8px;
    color: #58a6ff;
    text-decoration: none;
    font-size: 12px;
}

.content-preview-link:hover {
    text-decoration: underline;
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8b949e;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: rgba(35, 134, 54, 0.2);
    color: #3fb950;
}

.badge-inactive {
    background: rgba(218, 54, 51, 0.2);
    color: #f85149;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #8b949e;
}

.spinner {
    border: 2px solid #30363d;
    border-top: 2px solid #6c63ff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* Alert */
.alert {
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.alert-info {
    background: rgba(79, 161, 246, 0.1);
    border: 1px solid rgba(79, 161, 246, 0.3);
    color: #4fa1f6;
}

.alert-error {
    background: rgba(218, 54, 51, 0.1);
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: #f85149;
}

.alert-success {
    background: rgba(35, 134, 54, 0.1);
    border: 1px solid rgba(35, 134, 54, 0.3);
    color: #3fb950;
}

/* Collapsible config panel */
.config-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 12px 18px;
    color: #8b949e;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.config-toggle:hover { border-color: #6c63ff; color: #c9d1d9; }
.config-toggle[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-color: #6c63ff; color: #c9d1d9; }
.config-toggle .chevron { transition: transform 0.2s; }
.config-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.config-body {
    display: none;
    background: #161b22;
    border: 1px solid #6c63ff;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 20px;
}

.config-body.open { display: block; }

/* Scrollbar */
.panel-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.panel-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.panel-body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #3d444d;
}

/* ── Responsive widths ── */
@media (min-width: 600px) {
    .container { max-width: 600px; }
}

@media (min-width: 900px) {
    .container { max-width: 900px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1200px; }
}
