:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at 15% 50%, #1e1b4b, #0f172a);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Анимированные круги на фоне */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 20s infinite alternate ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.15);
    top: 10%;
    left: 10%;
}

body::after {
    width: 300px;
    height: 300px;
    background: rgba(239, 68, 68, 0.1);
    bottom: 20%;
    right: 15%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hidden { display: none !important; }

/* Экраны */
.screen {
    width: 100%;
    height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Экран логина */
#loginScreen {
    justify-content: center;
    align-items: center;
}

.login-panel {
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-panel h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-panel p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Дашборд Layout */
#dashboardScreen {
    display: flex;
    padding: 2rem;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: calc(100vh - 4rem);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 1px;
}

.server-selector {
    margin-bottom: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar for nav */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1;
    position: relative;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    flex-grow: 1;
    min-height: 0;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

.content-panel {
    padding: 2.5rem;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
}

.content-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Элементы форм */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.8rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

input:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select option {
    background: var(--bg-color);
}

.listbox {
    margin-top: 0.5rem;
    background-image: none;
    padding: 0;
    overflow-y: auto;
}

.listbox option {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}
.listbox option:hover {
    background: rgba(99, 102, 241, 0.2);
}
.listbox option:checked {
    background: var(--primary);
}

/* Кнопки */
.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}

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

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.icon-btn.danger {
    color: #f87171;
}

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Сообщения о статусе */
.status-msg, .error-msg {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.status-msg.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-msg.error, .error-msg {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Таблицы */
.table-container {
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Логи */
.logs-panel {
    padding: 0;
    overflow: hidden;
}

.logs-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.live-indicator {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.logs-container {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: monospace;
}

.log-entry {
    background: rgba(15, 23, 42, 0.6);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 4px;
    animation: slideIn 0.3s ease;
}

.log-entry.filtered-out {
    display: none;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.log-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.log-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-container {
    width: 90%;
    max-width: 450px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-main);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-container {
    transform: scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}
.modal-header h3 {
    margin: 0;
}

/* Music Player Styles */
.music-player-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.music-now-playing {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.music-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.music-info {
    flex: 1;
}

.music-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.music-author {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.music-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 5px;
    overflow: hidden;
}

.music-progress-fill {
    height: 100%;
    background: #a855f7;
    transition: width 1s linear;
}

.music-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}

.music-queue {
    max-height: 250px;
    overflow-y: auto;
}

.music-queue-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.music-queue-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: var(--danger);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

