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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: #2c2d30;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #3f4042;
}

.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 15px;
}

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

.user-info input {
    flex: 1;
    padding: 8px;
    border: 1px solid #3f4042;
    background: #1e1f22;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.user-info button {
    padding: 8px 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.user-info button:hover {
    background: #0056b3;
}

.streams-section, .topics-section {
    padding: 20px;
    border-bottom: 1px solid #3f4042;
}

.streams-section h2, .topics-section h2 {
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #8e8e93;
}

#streams-list, #topics-list {
    list-style: none;
    margin-bottom: 15px;
}

.stream-item, .topic-item {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stream-item > span, .topic-item > span {
    flex: 1;
}

.delete-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4444;
}

.stream-item:hover .delete-btn, .topic-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn.hidden {
    display: none;
}

.stream-item:hover, .topic-item:hover {
    background: #3f4042;
}

.stream-item.active {
    background: #007bff;
}

.topic-item {
    padding-left: 24px;
    color: #b9bbbe;
}

.topic-item.active {
    background: #3f4042;
    color: #fff;
}

#newStream {
    width: 100%;
    padding: 8px;
    background: #3f4042;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#newStream:hover {
    background: #4f5052;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.header h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

#current-topic {
    font-size: 14px;
    color: #666;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

.message {
    margin-bottom: 20px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.message-author {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.message-topic {
    font-size: 12px;
    color: #007bff;
    margin-right: 8px;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-content {
    color: #333;
    line-height: 1.5;
}

.topic-group {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.topic-group-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.topic-group-header:hover {
    background: #f0f0f0;
}

.topic-group-name {
    font-weight: 600;
    color: #4a90e2;
    font-size: 14px;
}

.topic-group-count {
    font-size: 12px;
    color: #666;
}

.topic-messages {
    padding: 8px 0;
}

.topic-group .message {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.topic-group .message:last-child {
    border-bottom: none;
}

.topic-group .message-header {
    margin-bottom: 4px;
}

.topic-group-input {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    gap: 8px;
    align-items: center;
}

.topic-message-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.topic-message-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.topic-send-button {
    padding: 8px 16px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.topic-send-button:hover {
    background: #357abd;
}

.topic-send-button:active {
    background: #2a5f8f;
}

.message-input {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

#topic-input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

#message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

#send-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

#send-button:hover {
    background: #0056b3;
}

#send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.name-entry-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.name-entry-container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.name-entry-container h1 {
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
}

.name-entry-container > p {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.name-entry-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.name-entry-form input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.name-entry-form input:focus {
    outline: none;
    border-color: #007bff;
}

.name-entry-form button {
    padding: 12px 24px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.name-entry-form button:hover {
    background: #0056b3;
}

.name-entry-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.name-hint {
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

#display-username {
    flex: 1;
    padding: 8px;
    background: #1e1f22;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

#logout-btn {
    padding: 8px 12px;
    background: #3f4042;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

#logout-btn:hover {
    background: #4f5052;
}

