:root {
    --primary-color: #3b82f6;
    --secondary-color: #6366f1;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-color: #f8fafc;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    margin: 0;
    background-image: radial-gradient(circle at top right, #1e293b, #0f172a);
    overflow: hidden;
}

.sidebar {
    width: 380px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    overflow: hidden;
}

.console-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.console-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    min-height: 0;
}

.console-section h3 {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 8px 0;
    display: flex;
    justify-content: space-between;
}

.console-log-mini {
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-content {
    margin-right: 380px;
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 40px;
}

.station-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.station-checkbox {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    user-select: none;
    position: relative;
}

.station-checkbox .check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.station-status {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-weight: 800;
    margin-left: 28px;
}

.station-status.online {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.station-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.station-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.station-checkbox.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.station-checkbox span {
    font-weight: 600;
    color: #94a3b8;
}

.station-checkbox.active span {
    color: var(--text-color);
}

.log-label-sent {
    color: #38bdf8;
    font-weight: 800;
    margin-right: 6px;
    font-size: 0.65rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(56, 189, 248, 0.1);
}

.log-label-received {
    color: #4ade80;
    font-weight: 800;
    margin-right: 6px;
    font-size: 0.65rem;
    border: 1px solid rgba(74, 222, 128, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(74, 222, 128, 0.1);
}

.command-sequence {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    min-height: 44px;
}

.command-tag {
    background: var(--secondary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease;
}

.command-tag .remove-cmd {
    cursor: pointer;
    font-weight: 800;
    opacity: 0.7;
}

.command-tag .remove-cmd:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-align: center;
}

.command-status-bar {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

#commandStatus {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

#commandStatus.active {
    width: 100%;
    background: var(--success-color);
}

.section-title {
    font-size: 1.25rem;
    margin: 24px 0 16px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.button.primary {
    background: var(--primary-color);
}

.scheduler-card {
    margin-top: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.scheduler-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scheduler-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

input,
select {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    outline: none;
}

.countdown {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.log-entry {
    margin-bottom: 6px;
    line-height: 1.4;
    word-break: break-all;
}

.log-time {
    color: #64748b;
    margin-right: 8px;
}

.log-sent {
    color: #60a5fa;
}

.log-received {
    color: #10b981;
}

.log-error {
    color: #ef4444;
}

.console-log-mini::-webkit-scrollbar {
    width: 6px;
}

.console-log-mini::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}