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

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

.screen {
    height: 100vh;
    width: 100vw;
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
#welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.welcome-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.logo h1 {
    font-size: 3em;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.logo p {
    font-size: 1.1em;
    color: #b0b0b0;
    margin-bottom: 40px;
}

.welcome-card {
    background: #2a2a2a;
    border-radius: 15px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #3a3a3a;
}

.welcome-card h2 {
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Main Screen Layout */
#main-screen {
    display: flex;
    background: #1a1a1a;
}

.sidebar {
    width: 300px;
    background: #2a2a2a;
    border-right: 1px solid #3a3a3a;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

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

.sidebar-header h2 {
    color: #00d4ff;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.user-info {
    color: #b0b0b0;
    font-size: 0.9em;
}

.rooms-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.section-header h3 {
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 500;
}

.btn-icon {
    background: #00d4ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #00b8e6;
    transform: scale(1.1);
}

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.room-item {
    background: #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.room-item:hover {
    background: #4a4a4a;
    border-color: #00d4ff;
}

.room-item.active {
    background: #00d4ff;
    color: #1a1a1a;
}

.room-item h4 {
    font-size: 1em;
    margin-bottom: 5px;
}

.room-item p {
    font-size: 0.85em;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #3a3a3a;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.no-room-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
}

.no-room-content {
    text-align: center;
    max-width: 400px;
}

.no-room-content h3 {
    color: #ffffff;
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 500;
}

.no-room-content p {
    color: #b0b0b0;
    margin-bottom: 30px;
    line-height: 1.6;
}

.chat-area {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.room-info h3 {
    color: #ffffff;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.room-info span {
    color: #00d4ff;
    font-size: 0.9em;
    font-weight: 500;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.messages {
    flex: 1;
    background: #1a1a1a;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

.message {
    max-width: 70%;
    word-wrap: break-word;
}

.message.own {
    align-self: flex-end;
}

.message.other {
    align-self: flex-start;
}

.message.system {
    align-self: center;
    max-width: 100%;
}

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

.nickname {
    font-weight: 600;
    font-size: 14px;
}

.message.own .nickname {
    color: #00d4ff;
}

.message.other .nickname {
    color: #00ff88;
}

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

.message-text {
    background: #3a3a3a;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    color: #e0e0e0;
    border: 1px solid #4a4a4a;
}

.message.own .message-text {
    background: #00d4ff;
    color: #1a1a1a;
    border-color: #00d4ff;
}

.system-message {
    text-align: center;
    font-style: italic;
    color: #888;
    font-size: 14px;
    padding: 10px;
    background: rgba(42, 42, 42, 0.7);
    border-radius: 20px;
    border: 1px solid #3a3a3a;
}

.message-input {
    background: #2a2a2a;
    padding: 20px;
    border-top: 1px solid #3a3a3a;
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.message-input input {
    flex: 1;
    padding: 15px;
    border: 1px solid #4a4a4a;
    border-radius: 25px;
    font-size: 16px;
    background: #3a3a3a;
    color: #e0e0e0;
    transition: border-color 0.3s ease;
}

.message-input input:focus {
    outline: none;
    border-color: #00d4ff;
}

.message-input input::placeholder {
    color: #888;
}

/* Buttons */
.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid #4a4a4a;
    border-radius: 10px;
    font-size: 16px;
    background: #3a3a3a;
    color: #e0e0e0;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #00d4ff;
}

.input-group input::placeholder {
    color: #888;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn.primary {
    background: #00d4ff;
    color: #1a1a1a;
}

.btn.primary:hover {
    background: #00b8e6;
    transform: translateY(-2px);
}

.btn.secondary {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #4a4a4a;
}

.btn.secondary:hover {
    background: #4a4a4a;
    transform: translateY(-2px);
}

.btn.danger {
    background: #ff4757;
    color: white;
}

.btn.danger:hover {
    background: #ff3742;
    transform: translateY(-2px);
}

.btn.small {
    padding: 8px 15px;
    font-size: 14px;
}

.join-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #3a3a3a;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    border: 1px solid #3a3a3a;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #ffffff;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #3a3a3a;
    color: #ffffff;
}

.modal-body {
    padding: 20px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
}

.notification.success {
    background: #00ff88;
    color: #1a1a1a;
    border-color: #00e67a;
}

.notification.error {
    background: #ff4757;
    border-color: #ff3742;
}

.notification.info {
    background: #00d4ff;
    color: #1a1a1a;
    border-color: #00b8e6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .welcome-container {
        padding: 20px;
    }
    
    .logo h1 {
        font-size: 2.5em;
    }
    
    .welcome-card {
        padding: 30px 20px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .messages {
        padding: 15px;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-input {
        padding: 15px;
        gap: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 0 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}