/* Admin tab styles - System monitoring, compact displays, collapsible logs */

/* Refresh interval selector */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-header h2 {
    margin-bottom: 0;
}

.refresh-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-selector label {
    margin-bottom: 0;
    font-size: 14px;
    color: #666;
}

body.dark-mode .refresh-selector label {
    color: #b0b0b0;
}

.refresh-selector select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

body.dark-mode .refresh-selector select {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

/* System resources row (RAM, CPU) */
.resources-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .resources-row {
        grid-template-columns: 1fr;
    }
}

.resource-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

body.dark-mode .resource-card {
    background: #1a1a1a;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.resource-title {
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

body.dark-mode .resource-title {
    color: #b0b0b0;
}

.resource-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

body.dark-mode .resource-value {
    color: #e0e0e0;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

body.dark-mode .progress-bar {
    background: #444;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.ok {
    background: #27ae60;
}

.progress-fill.warning {
    background: #f39c12;
}

.progress-fill.critical {
    background: #e74c3c;
}

/* Quick status row (Audio, Disk) */
.quick-status-row {
    display: flex;
    gap: 20px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

body.dark-mode .quick-status-row {
    background: #1a1a1a;
}

.quick-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

body.dark-mode .quick-status-item {
    color: #e0e0e0;
}

.quick-status-label {
    color: #666;
}

body.dark-mode .quick-status-label {
    color: #999;
}

/* Audio settings section */
.audio-settings-section {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

body.dark-mode .audio-settings-section {
    background: #1a1a1a;
}

.audio-settings-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    font-weight: 600;
}

body.dark-mode .audio-settings-section h3 {
    color: #b0b0b0;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.setting-row label {
    font-size: 14px;
    color: #333;
    margin: 0;
}

body.dark-mode .setting-row label {
    color: #e0e0e0;
}

.setting-row select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

body.dark-mode .setting-row select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.setting-row select:hover {
    border-color: #3498db;
}

.setting-hint {
    font-size: 12px;
    color: #666;
    width: 100%;
    margin-top: 4px;
}

body.dark-mode .setting-hint {
    color: #888;
}

/* Status circle indicator */
.status-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-circle.ok {
    background: #27ae60;
}

.status-circle.warning {
    background: #f39c12;
}

.status-circle.error {
    background: #e74c3c;
}

/* Services grid */
.services-section {
    margin-bottom: 15px;
}

.services-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

body.dark-mode .services-section h3 {
    color: #b0b0b0;
}

.services-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
}

body.dark-mode .service-item {
    background: #1a1a1a;
    color: #e0e0e0;
}

/* CPU top processes */
.processes-section {
    margin-bottom: 15px;
}

.processes-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

body.dark-mode .processes-section h3 {
    color: #b0b0b0;
}

.processes-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

body.dark-mode .processes-list {
    background: #1a1a1a;
}

.process-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 13px;
    font-family: monospace;
}

.process-item:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .process-item:not(:last-child) {
    border-bottom: 1px solid #333;
}

.process-name {
    color: #333;
}

body.dark-mode .process-name {
    color: #e0e0e0;
}

.process-cpu {
    color: #666;
    min-width: 50px;
    text-align: right;
}

body.dark-mode .process-cpu {
    color: #999;
}

/* Network status */
.network-section {
    margin-bottom: 15px;
}

.network-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

body.dark-mode .network-section h3 {
    color: #b0b0b0;
}

.network-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 500px) {
    .network-grid {
        grid-template-columns: 1fr;
    }
}

.network-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

body.dark-mode .network-item {
    background: #1a1a1a;
}

.network-info {
    flex: 1;
}

.network-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

body.dark-mode .network-label {
    color: #999;
}

.network-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

body.dark-mode .network-value {
    color: #e0e0e0;
}

.network-signal {
    font-size: 12px;
    color: #666;
}

body.dark-mode .network-signal {
    color: #999;
}

/* HLS viewers */
.viewers-section {
    margin-bottom: 15px;
}

.viewers-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

body.dark-mode .viewers-card {
    background: #1a1a1a;
}

.viewers-count {
    font-size: 32px;
    font-weight: 700;
    color: #3498db;
}

.viewers-label {
    font-size: 14px;
    color: #666;
}

body.dark-mode .viewers-label {
    color: #999;
}

.viewers-sublabel {
    font-size: 12px;
    color: #999;
}

body.dark-mode .viewers-sublabel {
    color: #666;
}

/* Uptime */
.uptime-section {
    margin-bottom: 15px;
}

.uptime-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

body.dark-mode .uptime-card {
    background: #1a1a1a;
}

.uptime-label {
    color: #666;
}

body.dark-mode .uptime-label {
    color: #999;
}

.uptime-value {
    color: #333;
    font-weight: 500;
}

body.dark-mode .uptime-value {
    color: #e0e0e0;
}

/* Collapsible logs */
.logs-section {
    margin-top: 20px;
}

.logs-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

body.dark-mode .logs-section h3 {
    color: #b0b0b0;
}

.log-collapsible {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .log-collapsible {
    border-color: #444;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.log-header:hover {
    background: #f0f0f0;
}

body.dark-mode .log-header {
    background: #1a1a1a;
}

body.dark-mode .log-header:hover {
    background: #222;
}

.log-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

body.dark-mode .log-toggle {
    color: #999;
}

.log-collapsible.expanded .log-toggle {
    transform: rotate(90deg);
}

.log-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

body.dark-mode .log-title {
    color: #e0e0e0;
}

.log-content {
    display: none;
    padding: 12px;
    background: #1a1a2e;
    max-height: 300px;
    overflow-y: auto;
}

.log-collapsible.expanded .log-content {
    display: block;
}

.log-lines {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-empty {
    color: #666;
    font-style: italic;
}

/* Loading state */
.admin-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

body.dark-mode .admin-loading {
    color: #999;
}

/* Error state */
.admin-error {
    padding: 15px;
    background: #fef0f0;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    color: #c0392b;
    margin-bottom: 15px;
}

body.dark-mode .admin-error {
    background: #2a1a1a;
    color: #e74c3c;
}

/* ============================================
   Users Management Section
   ============================================ */

.users-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .users-section {
    border-top-color: #444;
}

.users-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    font-weight: 600;
}

body.dark-mode .users-section h3 {
    color: #b0b0b0;
}

/* Add User Section */
.add-user-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .add-user-section {
    border-top-color: #444;
}

.add-user-section h3 {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    font-weight: 600;
}

body.dark-mode .add-user-section h3 {
    color: #b0b0b0;
}

/* Add User Form */
.user-add-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 0;
}

form.user-add-form,
form.password-form-row {
    margin: 0;
    padding: 0;
}

.user-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

body.dark-mode .user-input {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

.user-input:focus {
    outline: none;
    border-color: #3498db;
}

.user-input::placeholder {
    color: #999;
}

body.dark-mode .user-input::placeholder {
    color: #666;
}

.btn-add-user {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-add-user:hover {
    background: #219a52;
}

/* Users List */
.users-list {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .users-list {
    background: #1a1a1a;
}

.users-loading,
.users-empty,
.users-error {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

body.dark-mode .users-loading,
body.dark-mode .users-empty {
    color: #999;
}

.users-error {
    color: #e74c3c;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .user-item {
    border-bottom-color: #333;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item.current-user {
    background: rgba(52, 152, 219, 0.1);
}

body.dark-mode .user-item.current-user {
    background: rgba(52, 152, 219, 0.15);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

body.dark-mode .user-name {
    color: #e0e0e0;
}

.user-meta,
.user-last-login {
    font-size: 12px;
    color: #666;
}

body.dark-mode .user-meta,
body.dark-mode .user-last-login {
    color: #999;
}

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

.btn-delete-user {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-user:hover {
    background: #c0392b;
}

/* Change Password Section */
.password-change-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .password-change-section {
    border-top-color: #333;
}

.password-change-section h4 {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

body.dark-mode .password-change-section h4 {
    color: #b0b0b0;
}

.password-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-change-password {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-change-password:hover {
    background: #2980b9;
}

/* Mobile Responsive */
@media (max-width: 500px) {
    .user-add-form {
        flex-direction: column;
    }

    .user-input {
        min-width: 100%;
    }

    .btn-add-user {
        width: 100%;
    }

    .user-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

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

    .user-actions {
        flex-shrink: 0;
    }

    .btn-delete-user {
        padding: 4px 8px;
        font-size: 11px;
    }

    .password-form-row {
        flex-direction: column;
    }

    .password-form-row .user-input {
        width: 100%;
    }

    .btn-change-password {
        width: 100%;
    }
}
