/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #2d3748;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Main Container */
.chat-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.chat-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.room-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-title .material-icons {
    color: #667eea;
    font-size: 1.6rem;
}

.room-subtitle {
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.btn-video {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-icon {
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f7fafc;
    color: #4a5568;
    transform: scale(1.1);
}

/* Chat Layout */
.chat-layout {
    display: flex;
    flex: 1;
    gap: 0;
    height: calc(100vh - 100px);
}

/* Rooms Panel */
.rooms-panel {
    width: 280px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}

.rooms-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

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

.room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.room-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.room-item:hover::before {
    left: 100%;
}

.room-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.room-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.room-item.current .room-name {
    color: white;
}

.room-item.current .room-users {
    color: rgba(255, 255, 255, 0.8);
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.room-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.2;
}

.room-users {
    font-size: 0.8rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 4px;
}

.room-users .material-icons {
    font-size: 0.75rem;
}

.room-item.current .room-users .material-icons {
    color: rgba(255, 255, 255, 0.8);
}

.join-room-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    white-space: nowrap;
}

.room-item.current .join-room-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.join-room-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.create-room-section {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 15px;
}

.create-room-section h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.create-room-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.create-room-form input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
}

.create-room-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.create-room-form .btn {
    padding: 8px;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: #10b981;
}

.status-text {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

.chat-controls {
    display: flex;
    gap: 5px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Message Styles */
.message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease-out;
}

.message-content {
    display: inline-block;
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message.received .message-content {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
}

.message.system .message-content {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    text-align: center;
    max-width: 100%;
    font-size: 0.85rem;
    font-style: italic;
}

.message-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-time {
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

/* Chat Input */
.chat-input-container {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 20px;
}

.chat-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 5px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 0.95rem;
    color: #2d3748;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #a0aec0;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 5px;
}

.send-btn {
    padding: 10px;
    border-radius: 50%;
    min-width: 40px;
    height: 40px;
}

/* Room Switcher - Removed modal styles */

/* User Panel */
.user-panel {
    width: 300px;
    background: white;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
}

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

.panel-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.user-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: fadeInUp 0.3s ease-out;
}

.user-list li:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    flex: 1;
    font-weight: 500;
    color: #FFFFFF;

}

.user-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.panel-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
}

/* Typing Indicator */
.typing-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    z-index: 1000;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Connection Status */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: #f0fdf4;
    color: #166534;
}

.connection-status.disconnected {
    background: #fef2f2;
    color: #dc2626;
}

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

.emoji-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.emoji-header h4 {
    font-family: 'Poppins', sans-serif;
    color: #2d3748;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.emoji {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.emoji:hover {
    background: #f7fafc;
    transform: scale(1.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .user-panel {
        width: 250px;
    }
    
    .rooms-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
    }
    
    .rooms-panel {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .rooms-list-container {
        max-height: 120px;
    }
    
    .user-panel {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
    
    .panel-actions {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .panel-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .room-title {
        font-size: 1.4rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    .input-wrapper {
        border-radius: 20px;
    }
    
    .input-wrapper input {
        padding: 10px 12px;
    }
    
    .create-room-form {
        flex-direction: row;
        gap: 8px;
    }
    
    .create-room-form input {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .chat-container {
        margin: 0;
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .panel-actions {
        flex-direction: column;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .chat-container {
        background: rgba(26, 32, 44, 0.95);
        color: #e2e8f0;
    }
    
    .chat-header,
    .chat-header-bar,
    .chat-input-container,
    .user-panel {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .room-title,
    .panel-title {
        color: #e2e8f0;
    }
    
    .chat-messages {
        background: #1a202c;
    }
    
    .message.received .message-content {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .input-wrapper {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .input-wrapper input {
        color: #e2e8f0;
    }
    
    .input-wrapper input::placeholder {
        color: #718096;
    }
    
    .user-list li {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .user-list li:hover {
        background: #4a5568;
    }
} 
