/* Hear BJB Cloud Admin - Styles */

:root {
    --primary: #845415;
    --primary-light: #ECAD67;
    --surface: #F7FAFB;
    --surface-container: #EBEEEF;
    --on-surface: #181C1D;
    --on-surface-muted: #5F6466;
    --tertiary: #186C33;
    --tertiary-light: #87D992;
    --error: #BA1A1A;
    --success: #186C33;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ECAD67;
        --primary-light: #845415;
        --surface: #181C1D;
        --surface-container: #2D3132;
        --on-surface: #F7FAFB;
        --on-surface-muted: #C4C7C8;
        --tertiary-light: #87D992;
    }
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--surface-container);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-card h2 {
    font-size: 1.25rem;
    margin-bottom: 32px;
    color: var(--on-surface-muted);
}

/* Header */
.header {
    background: var(--surface-container);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface-container);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--on-surface);
}

/* Server Grid */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.server-card {
    background: var(--surface-container);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.server-card.offline {
    opacity: 0.6;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.server-header h3 {
    font-size: 1.25rem;
    color: var(--on-surface);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.online {
    background: var(--tertiary-light);
    color: var(--tertiary);
}

.status-badge.offline {
    background: var(--error);
    color: white;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.info-item .label {
    color: var(--on-surface-muted);
}

.info-item .value {
    font-weight: 600;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--surface-container);
    color: var(--on-surface);
}

.btn-secondary:hover {
    background: var(--on-surface-muted);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--surface-container);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--on-surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--on-surface-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 12px;
    padding: 12px;
    background: rgba(186, 26, 26, 0.1);
    border-radius: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--surface-container);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--on-surface-muted);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: var(--on-surface);
}

.modal-body {
    padding: 24px;
}

/* Hardware & Channels List */
.hardware-section,
.channels-section {
    margin-bottom: 32px;
}

.hardware-section h3,
.channels-section h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hardware-list,
.channels-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hardware-item,
.channel-item {
    background: var(--surface-container);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hardware-item strong {
    color: var(--primary);
}

.hw-id {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--on-surface-muted);
}

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

.channel-item h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.channel-item .channel-config {
    font-size: 0.875rem;
    color: var(--on-surface-muted);
}

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

.default-badge {
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--surface-container);
    color: var(--on-surface);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: var(--tertiary);
    color: white;
}

.toast.error {
    background: var(--error);
    color: white;
}

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

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--on-surface-muted);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--on-surface-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .servers-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.25rem;
    }
}
