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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(102, 126, 234, 0.95);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(118, 75, 162, 0.95);
    transform: rotate(90deg) scale(1.1);
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-content {
    padding: 30px;
}

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

.settings-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.btn-close {
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

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

.feedback-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.feedback-section p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
}

.feedback-section textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

.feedback-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-feedback {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-feedback:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.feedback-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.feedback-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.feedback-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#streamInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#streamInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.help-text {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.help-text p {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.help-text ul {
    list-style: none;
    padding-left: 10px;
}

.help-text li {
    margin: 4px 0;
    padding-left: 20px;
    position: relative;
}

.help-text li:before {
    content: "→";
    position: absolute;
    left: 0;
}

.chats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 10px;
    flex: 1;
    padding: 10px;
    height: 100%;
    overflow: hidden;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8b9dc3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.chat-card {
    background: #16213e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.3s ease-out;
}

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

.chat-header {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-info {
    flex: 1;
}

.chat-platform {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.chat-channel {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.btn-remove, .btn-popout {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover, .btn-popout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-popout {
    font-size: 1rem;
}

.chat-iframe-container {
    flex: 1;
    position: relative;
    background: #f0f0f0;
}

.chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
}

.error-message {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin-bottom: 15px;
    display: none;
}

.error-message.show {
    display: block;
}

@media (max-width: 768px) {
    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .input-group {
        flex-direction: column;
    }

    .chats-container {
        grid-template-columns: 1fr;
        padding: 5px;
        gap: 5px;
    }

    .settings-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
}
