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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #00a884 0%, #00a884 127px, #e5ddd5 127px, #e5ddd5 100%);
    min-height: 100vh;
}

/* Landing Page */
.landing-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #00a884 0%, #128C7E 100%);
}

.landing-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.landing-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.landing-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.landing-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Auth Pages */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #00a884 0%, #128C7E 100%);
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h2 {
    text-align: center;
    color: #128C7E;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #00a884;
    color: white;
}

.btn-primary:hover {
    background: #128C7E;
}

.btn-secondary {
    background: white;
    color: #00a884;
    border: 1px solid #00a884;
}

.btn-secondary:hover {
    background: #f0f0f0;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.auth-link a {
    color: #00a884;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Chat App Layout */
.chat-app {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Sidebar */
.sidebar {
    width: 350px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    background: #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile h3 {
    font-size: 1rem;
    color: #333;
}

.status {
    font-size: 0.8rem;
    color: #666;
}

.status.online {
    color: #00a884;
}

.header-icons {
    display: flex;
    gap: 1.5rem;
}

.header-icons i {
    color: #54656f;
    font-size: 1.2rem;
    cursor: pointer;
}

.search-container {
    padding: 0.5rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
}

.search-container input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.btn-search {
    padding: 0.5rem 1rem;
    background: #00a884;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.chat-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-item:hover {
    background: #f5f6f6;
}

.chat-item.active {
    background: #f0f2f5;
}

.chat-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.chat-info {
    flex: 1;
}

.chat-info h4 {
    margin-bottom: 0.25rem;
    color: #333;
}

.last-message {
    font-size: 0.9rem;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    text-align: right;
    font-size: 0.8rem;
    color: #667781;
}

.unread-count {
    background: #00a884;
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
}

.chat-header {
    padding: 1rem;
    background: #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

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

.chat-user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-user-info h3 {
    font-size: 1rem;
    color: #333;
}

.chat-header-icons {
    display: flex;
    gap: 1.5rem;
}

.chat-header-icons i {
    color: #54656f;
    font-size: 1.2rem;
    cursor: pointer;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #efeae2;
}

.welcome-message {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #667781;
}

.welcome-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    margin-bottom: 0.5rem;
}

.message {
    display: flex;
    margin-bottom: 1rem;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 65%;
    padding: 0.75rem 1rem;
    border-radius: 7.5px;
    position: relative;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: #d9fdd3;
    border-top-right-radius: 0;
}

.message.received .message-content {
    background: white;
    border-top-left-radius: 0;
}

.message-time {
    font-size: 0.7rem;
    color: #667781;
    margin-top: 0.25rem;
    text-align: right;
}

.message-status {
    margin-left: 0.25rem;
    color: #00a884;
}

.message-input-container {
    padding: 1rem;
    background: #f0f2f5;
}

.typing-indicator {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #667781;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #667781;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-wrapper i {
    color: #54656f;
    font-size: 1.2rem;
    cursor: pointer;
}

.input-wrapper input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #00a884;
}

.btn-send {
    background: #00a884;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.btn-send:hover {
    background: #128C7E;
}

.btn-send i {
    color: white;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-app {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 50%;
    }
    
    .chat-area {
        height: 50%;
    }
}

/* Message status indicators */
.message-status {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.message-status .fa-check-double {
    color: #00a884;
}

.message-status .fa-clock {
    color: #999;
    animation: pulse 1.5s infinite;
}

/* Error state for messages */
.message-error .message-content {
    background: #ffebee !important;
    border: 1px solid #ef5350;
}

.message-error .message-status .fa-exclamation-circle {
    color: #ef5350;
}

/* Typing animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Message hover effect */
.message-content:hover {
    filter: brightness(0.98);
}

/* Message groups */
.message + .message {
    margin-top: 0.5rem;
}

.message.sent + .message.sent {
    margin-top: 0.2rem;
}

.message.received + .message.received {
    margin-top: 0.2rem;
}