:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --primary: #f43f5e;
    /* TikTok Pink-ish */
    --secondary: #3b82f6;
    /* Blue */
    --accent: #22d3ee;
    /* Cyan */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 1.8rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Connect Panel */
.connect-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
}

input[type="text"] {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    min-width: 250px;
}

input[type="text"]:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #e11d48);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.btn-primary:hostname {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

/* Forms & Controls */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

select {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    outline: none;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--secondary);
}

/* Checkbox List */
.checkbox-list {
    display: grid;
    gap: 0.8rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Sound List */
.sound-list {
    display: grid;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sound-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

.sound-gift-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.sound-info {
    flex: 1;
}

.sound-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.sound-trigger {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.dot.connected {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Custom Dropdown for Images */
.custom-select-container {
    position: relative;
    width: 100%;
    font-size: 0.9rem;
}

.custom-select-trigger {
    background: #334155;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.custom-select-options.open {
    display: block;
}

.custom-option {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.custom-option:hover {
    background: #334155;
}

.custom-option.selected {
    background: #0f172a;
    border-left: 3px solid var(--secondary);
}

.gift-icon-sm {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
}