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

body {
    font-family: system-ui, sans-serif;
    background: #111;
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 0.9rem;
}

header {
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    border-bottom: 1px solid #2a2a2a;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

main {
}

section {
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    padding: 1rem;
    border-bottom: 1px solid #2a2a2a;
}

.url-section {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

label {
    color: #999;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
}

#editor {
    width: 100%;
    height: 95px;
    padding: 1rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    color: #e0e0e0;
    font-family: Monaco, monospace;
    font-size: 0.8rem;
    resize: vertical;
    outline: none;
}

#editor.error {
    border-left: 3px solid #ef4444;
}

#validation-error {
    display: none;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.8rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

input, select {
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0.25rem;
    color: #e0e0e0;
    font-size: 0.8rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.url-section input[readonly] {
    font-family: Monaco, monospace;
    flex: 1;
    min-width: 0;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#toggleButton.connected {
    background: #ef4444;
    color: white;
}

#toggleButton.disconnected {
    background: #10b981;
    color: white;
}

#toggleButton:hover {
    transform: translateY(-1px);
}

#clearButton {
    background: #374151;
    color: #e0e0e0;
}

#clearButton:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

#stream {
    min-height: 300px;
}

#stream > div:first-child {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

pre {
    margin: 0.5rem 0;
    padding: 1rem;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid #2a2a2a;
    border-radius: 0.25rem;
    font-family: Monaco, monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    animation: fadeIn 0.3s ease-out;
}

pre.highlight {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    animation: highlightFade 1s ease-out forwards;
    overflow: auto;
}


@keyframes highlightFade {
    0% { 
        background: rgba(16, 185, 129, 0.1);
        border-color: #10b981;
    }
    100% { 
        background: rgba(26, 26, 26, 0.8);
        border-color: #2a2a2a;
    }
}

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

@media (max-width: 768px) {
    .url-section input[readonly] {
        width: 100%;
    }
    section > div {
        flex-direction: column;
        align-items: stretch;
    }
    
    label {
        min-width: auto;
    }
}