@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --wa-green-dark: #008069;
    --wa-green-light: #25d366;
    --wa-bg: #f0f2f5;
    --wa-sidebar-bg: #ffffff;
    --wa-chat-bg: #efeae2;
    --wa-msg-out: #d9fdd3;
    --wa-msg-in: #ffffff;
    --wa-text-primary: #111b21;
    --wa-text-secondary: #667781;
    --wa-border: #e9edef;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--wa-bg);
    overflow: hidden;
    height: 100vh;
}

/* Auth Pages */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #008069 0%, #00a884 100%);
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    transform: translateY(0);
    transition: var(--transition);
}

.auth-card:hover {
    transform: translateY(-5px);
}

.auth-card h2 {
    color: var(--wa-green-dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--wa-text-secondary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--wa-border);
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--wa-green-light);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--wa-green-dark);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #006a57;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.8rem;
    background: white;
    border: 1px solid var(--wa-border);
    border-radius: 10px;
    cursor: pointer;
    margin-top: 1rem;
    transition: var(--transition);
}

.google-btn:hover {
    background: #f8f9fa;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Sidebar */
.sidebar {
    width: 400px;
    border-right: 1px solid var(--wa-border);
    display: flex;
    flex-direction: column;
    background: var(--wa-sidebar-bg);
}

.sidebar-header {
    padding: 10px 16px;
    background: #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

.header-icons {
    display: flex;
    gap: 20px;
    color: var(--wa-text-secondary);
}

.search-container {
    padding: 7px 12px;
    background: #fff;
    border-bottom: 1px solid #f6f6f6;
}

.search-box {
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    padding: 4px 10px;
    font-size: 0.9rem;
    width: 100%;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f6f6f6;
}

.chat-item:hover {
    background: #f5f6f6;
}

.chat-item.active {
    background: #ebebeb;
}

.chat-info {
    flex: 1;
    margin-left: 15px;
    overflow: hidden;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-name {
    font-weight: 500;
    color: var(--wa-text-primary);
}

.chat-time {
    font-size: 0.75rem;
    color: var(--wa-text-secondary);
}

.chat-msg {
    font-size: 0.85rem;
    color: var(--wa-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Window */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--wa-chat-bg);
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    position: relative;
}

.chat-header {
    background: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--wa-border);
    z-index: 10;
}

.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 5%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 65%;
    padding: 6px 12px;
    border-radius: 8px;
    position: relative;
    font-size: 0.9rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    background: var(--wa-msg-out);
    align-self: flex-end;
}

.message.received {
    background: var(--wa-msg-in);
    align-self: flex-start;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--wa-text-secondary);
    float: right;
    margin-top: 5px;
    margin-left: 10px;
}

.chat-footer {
    background: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-box {
    flex: 1;
    background: white;
    border-radius: 24px;
    padding: 9px 12px;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.icon {
    color: var(--wa-text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
}

.send-btn {
    color: var(--wa-green-dark);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 300px;
    }
}

@media (max-width: 700px) {
    .sidebar {
        width: 100%;
    }

    .chat-window {
        display: none;
    }

    .app-container.chat-active .sidebar {
        display: none;
    }

    .app-container.chat-active .chat-window {
        display: flex;
        width: 100%;
    }
}

/* Empty State */
.empty-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 6px solid #25d366;
}

.empty-content h1 {
    font-size: 2rem;
    color: #41525d;
    font-weight: 300;
}

.empty-content p {
    color: #667781;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes messageIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message {
    animation: messageIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}