* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    overflow-x: hidden;
}

.mobile-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px; /* Space for bottom nav */
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

    .chat-header h1 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
    }

/* Chat List */
.chat-list {
    padding: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

    .chat-item:hover {
        background: #f8f9fa;
    }

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 12px;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-preview {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    color: #999;
    font-size: 0.8rem;
}

/* Search Bar */
.search-bar {
    padding: 10px;
    background: white;
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

    .search-result-item:hover {
        background: #f8f9fa;
    }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #ddd;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
}

    .nav-item.active {
        color: #667eea;
    }

    .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .nav-item span {
        font-size: 0.8rem;
    }

/* Chat Room */
.chat-room-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.back-btn {
    color: #667eea;
    font-size: 1.2rem;
    margin-right: 15px;
    text-decoration: none;
}

.chat-info {
    flex: 1;
}

.chat-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-status {
    color: #666;
    font-size: 0.9rem;
}

/* Messages */
.messages-container {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

    .message.sent {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 4px;
    }

    .message.received {
        background: #f0f2f5;
        color: #333;
        margin-right: auto;
        border-bottom-left-radius: 4px;
    }

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
}

.message-content {
    word-wrap: break-word;
}

.message-time {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 4px;
    opacity: 0.8;
}



/* Responsive Design */
@@media (max-width: 768px) {
    .mobile-container {
        width: 100%;
    }
}

@@media (min-width: 769px) {
    .mobile-container {
        max-width: 500px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 50px;
}

    .auth-container h2 {
        color: #667eea;
        font-weight: 600;
    }

.form-control {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    padding: 40px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-icon {
    color: #667eea;
    margin-bottom: 30px;
}

.welcome-title {
    color: #333;
    font-weight: 700;
    margin-bottom: 10px;
}

.welcome-subtitle {
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.features-list {
    text-align: left;
    margin: 30px auto;
    max-width: 300px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
}

    .feature-item i {
        margin-right: 15px;
        font-size: 1.2rem;
        width: 24px;
    }

.welcome-buttons {
    margin-top: 40px;
}

.btn-lg {
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
}

/* Profile Styles */
.profile-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.profile-avatar {
    margin-bottom: 15px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.profile-email {
    font-size: 0.9rem;
}

.profile-actions .btn {
    border-radius: 10px;
    padding: 10px;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 15px 20px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    border-left: 4px solid #667eea;
}

    .notification.show {
        transform: translateX(0);
    }

.notification-success {
    border-left-color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-warning {
    border-left-color: #ffc107;
}

.notification-info {
    border-left-color: #17a2b8;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification i {
    font-size: 1.2rem;
}

.notification-success i {
    color: #28a745;
}

.notification-error i {
    color: #dc3545;
}

.notification-warning i {
    color: #ffc107;
}

.notification-info i {
    color: #17a2b8;
}

/* Dark mode support */
.dark-mode .notification {
    background: #334155;
    color: #e2e8f0;
}