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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

/* Splash Screen */
.splash-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: 9999;
    animation: splashFadeOut 0.8s ease-in-out 2.5s forwards;
}

.splash-container {
    text-align: center;
    color: white;
    animation: splashSlideUp 1s ease-out;
}

.splash-logo {
    margin-bottom: 3rem;
}

.splash-icon {
    font-size: 4rem;
    color: white;
    margin-bottom: 1rem;
    animation: splashIconPulse 2s ease-in-out infinite;
}

.splash-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0.5rem 0;
    letter-spacing: -0.02em;
    animation: splashTextSlide 1s ease-out 0.3s both;
}

.splash-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
    margin: 0;
    animation: splashTextSlide 1s ease-out 0.6s both;
}

.splash-loader {
    margin-top: 2rem;
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.dot1 {
    animation-delay: -0.32s;
}

.dot2 {
    animation-delay: -0.16s;
}

.dot3 {
    animation-delay: 0s;
}

.loading-text {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
    margin: 0;
    animation: loadingTextFade 2s ease-in-out infinite;
}

/* Splash Animations */
@keyframes splashFadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

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

@keyframes splashIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

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

/* Hidden class */
.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.6s ease-out;
}

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

.login-header .chat-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #718096;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.google-login-btn {
    background: #4285f4;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.google-login-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.3);
}

.login-features {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #718096;
    font-size: 0.9rem;
}

.feature i {
    color: #667eea;
    font-size: 1.2rem;
}

/* Chat Screen */
.chat-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f7fafc;
}

.chat-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left i {
    color: #667eea;
    font-size: 1.5rem;
}

.header-left h2 {
    color: #2d3748;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #667eea;
    object-fit: cover;
}

.logout-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.logout-btn:hover {
        background: #c53030;
        transform: scale(1.05);
    }

    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: none;
        background: none;
        border: none;
        color: #667eea;
        font-size: 1.25rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        margin-right: 0.5rem;
    }

    .mobile-menu-btn:hover {
        background: #e6fffa;
        color: #38b2ac;
    }

    /* Mobile Chat Navigation */
    .mobile-chat-nav {
        display: none;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem;
        gap: 0.25rem;
        justify-content: space-around;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        background: none;
        border: none;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        color: #718096;
        font-size: 0.8rem;
        font-weight: 500;
        min-width: 70px;
    }

    .mobile-nav-btn i {
        font-size: 1.1rem;
        margin-bottom: 0.125rem;
    }

    .mobile-nav-btn.active {
        background: #667eea;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .mobile-nav-btn:not(.active):hover {
        background: #f7fafc;
        color: #4a5568;
        transform: translateY(-1px);
    }

.chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h3 {
    color: #2d3748;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.online-count {
    background: #48bb78;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.online-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.online-user:hover {
    background: #e6fffa;
    border-color: #38b2ac;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(56, 178, 172, 0.15);
}

.online-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #48bb78;
    object-fit: cover;
}

.online-user span {
    font-weight: 500;
    color: #2d3748;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f7fafc;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlide 0.3s ease-out;
}

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

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.message-content {
    max-width: 70%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message.own .message-header {
    flex-direction: row-reverse;
}

.message-author {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.8rem;
    color: #718096;
}

.message-text {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
}

.message.own .message-text {
    background: #667eea;
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #718096;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #718096;
    border-radius: 50%;
    animation: typingDots 1.4s infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDots {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Message Input */
.message-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.attach-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.attach-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.file-info i {
    color: var(--primary-color);
    font-size: 18px;
}

.remove-file-btn {
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    margin-left: auto;
    font-size: 12px;
}

.remove-file-btn:hover {
    background: #c0392b;
}

.message.file-message {
    border-left: 4px solid var(--primary-color);
}

.file-attachment {
    margin-top: 8px;
    padding: 10px;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.file-attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.file-attachment-info i {
    color: var(--primary-color);
    font-size: 20px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.download-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: var(--primary-dark);
}

.image-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-preview:hover {
    transform: scale(1.02);
}

.hidden {
    display: none !important;
}

#messageInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    border-color: #667eea;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Loading Overlay */
.loading-overlay {
    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: 1000;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    object-fit: cover;
}

.modal-user-details h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-user-details p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-color);
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #38b2ac 0%, #2c7a7b 100%);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(56, 178, 172, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2c7a7b 0%, #285e61 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 178, 172, 0.4);
    border-color: #38b2ac;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(56, 178, 172, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #2d3748;
    font-weight: 500;
    border: 2px solid #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #a0aec0;
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */

/* Tablet Styles */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .chat-header {
        padding: 1rem 1.5rem;
    }
    
    .login-container {
        max-width: 500px;
        margin: 2rem auto;
        padding: 2.5rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* General Mobile Optimizations */
    body {
        font-size: 14px;
    }
    
    /* Splash Screen Mobile */
    .splash-screen {
        padding: 1rem;
    }
    
    .splash-logo {
        width: 80px;
        height: 80px;
    }
    
    .splash-title {
        font-size: 2rem;
    }
    
    .splash-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    /* Login Screen Mobile */
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .google-login-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .login-features {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .feature {
        flex-direction: row;
        justify-content: center;
        gap: 0.75rem;
    }
    
    /* Chat Header Mobile */
     .chat-header {
         padding: 0.75rem 1rem;
         position: relative;
     }
     
     .mobile-menu-btn {
         display: inline-flex;
         align-items: center;
         justify-content: center;
     }
     
     .header-left {
         align-items: center;
     }
     
     .header-left h2 {
         font-size: 1.1rem;
     }
     
     .header-left i:not(.mobile-menu-btn i) {
         font-size: 1.25rem;
     }
    
    .header-right .user-info span {
        display: none;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .logout-btn {
        width: 32px;
        height: 32px;
        padding: 0.25rem;
    }
    
    /* Sidebar Mobile - Hidden by default, can be toggled */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Mobile Chat Navigation */
      .mobile-chat-nav {
          display: flex;
      }
      
      /* Hide desktop chat header info on mobile */
      .chat-header-info {
          display: none;
      }
     
     /* Chat Main Mobile */
     .chat-main {
         width: 100%;
     }
    
    /* Messages Mobile */
    .messages-container {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .message {
        gap: 0.5rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-text {
        padding: 0.625rem 0.875rem;
        border-radius: 16px;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .message-header {
        margin-bottom: 0.125rem;
    }
    
    .message-author {
        font-size: 0.8rem;
    }
    
    .message-time {
        font-size: 0.7rem;
    }
    
    /* Input Area Mobile */
    .input-container {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .message-input {
        font-size: 1rem; /* Prevent zoom on iOS */
        padding: 0.75rem;
    }
    
    .send-btn, .file-btn {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
    
    /* Modal Mobile */
    .modal-content {
        width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: 60vh;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* File Upload Mobile */
    .file-upload-area {
        padding: 2rem 1rem;
        font-size: 0.9rem;
    }
    
    .file-preview {
        max-width: 100%;
        max-height: 200px;
    }
    
    /* Private Chat Mobile */
    .private-chat-item {
        padding: 0.75rem;
    }
    
    .private-chat-avatar {
        width: 40px;
        height: 40px;
    }
    
    .private-chat-name {
        font-size: 0.9rem;
    }
    
    .private-chat-last-message {
        font-size: 0.8rem;
    }
    
    /* Touch Optimizations */
    .online-user,
    .private-chat-item,
    .google-login-btn,
    .send-btn,
    .file-btn,
    .logout-btn {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    /* Typing Indicator Mobile */
    .typing-indicator {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .splash-logo {
        width: 60px;
        height: 60px;
    }
    
    .splash-title {
        font-size: 1.75rem;
    }
    
    .splash-subtitle {
        font-size: 0.9rem;
    }
    
    .login-container {
        margin: 0.5rem;
        padding: 1.25rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .google-login-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .chat-header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-left h2 {
        font-size: 1rem;
    }
    
    .messages-container {
        padding: 0.5rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .message-text {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .input-container {
        padding: 0.5rem;
    }
    
    .message-input {
        padding: 0.625rem;
        font-size: 1rem;
    }
    
    .send-btn, .file-btn {
        width: 36px;
        height: 36px;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.5rem auto;
        border-radius: 12px;
    }
}

/* Scrollbar Styling */
.messages-container::-webkit-scrollbar,
.online-users-list::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track,
.online-users-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.messages-container::-webkit-scrollbar-thumb,
.online-users-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.online-users-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Private Chat Styles */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #10b981;
    border-radius: 50%;
    width: 8px;
    height: 8px;
    animation: pulse 2s infinite;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.5);
    border: 1px solid white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(16, 185, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
}

/* Empty Chat Placeholder */
.empty-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-chat-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-chat-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.empty-chat-placeholder p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.tab-btn:hover {
    background: rgba(74, 144, 226, 0.05);
}

.tab-content {
    display: none;
    height: calc(100% - 50px);
}

.tab-content.active {
    display: block;
}

.new-chat-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-chat-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.private-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.private-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 10px;
    position: relative;
}

.private-chat-item:hover {
    background: rgba(74, 144, 226, 0.1);
}

.private-chat-item.active {
    background: var(--primary-color);
    color: white;
}

.private-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.private-chat-info {
    flex: 1;
    min-width: 0;
}

.private-chat-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.private-chat-last-message {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.private-chat-item.active .private-chat-last-message {
    color: rgba(255, 255, 255, 0.8);
}

.chat-header-info {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-mode-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.back-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #6c757d;
}

/* Modal Styles */
.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: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.users-search {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
}

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

.available-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.available-user-item:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
}

.available-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.available-user-info {
    flex: 1;
}

.available-user-name {
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.available-user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Search functionality */
.search-container {
    position: relative;
    margin-bottom: 10px;
}

.search-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
}

/* Message status indicators */
.message-status {
    font-size: 12px;
    margin-left: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.status-sent {
    color: #666;
}

.status-delivered {
    color: #007bff;
}

.status-read {
    color: #28a745;
}

/* Private chat enhancements */
.private-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.private-chat-time {
    font-size: 11px;
    color: #666;
    opacity: 0.8;
}

.private-chat-last-message {
    font-size: 13px;
    color: #666;
    opacity: 0.9;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Typing indicator animation */
.typing-indicator {
    animation: fadeInOut 1.5s ease-in-out infinite;
}

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

/* Message animations */
.message {
    animation: slideInMessage 0.3s ease-out;
}

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

/* Status animation */
.message-status {
    animation: statusAppear 0.5s ease-out;
}

@keyframes statusAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 0.7;
        transform: scale(1);
    }
}