/* CSS Variables */
:root {
    --primary-red: #E63946;
    --primary-red-dark: #c92a36;
    --primary-red-light: #ff6b6b;
    --white: #ffffff;
    --bg-light: #f0f2f5;
    --bg-chat: #efeae2;
    --text-dark: #111b21;
    --text-gray: #667781;
    --text-light: #8696a0;
    --border-color: #e9edef;
    --message-out: #d9fdd3;
    --message-in: #ffffff;
    --online-green: #25d366;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

/* Top Banner */
.top-banner {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-dark);
}

.banner-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Landing Page */
.landing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-container {
    margin-bottom: 24px;
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.main-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 32px;
}

.subtitle em {
    font-style: italic;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-red-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(230, 57, 70, 0.1);
}

/* Install Section */
.install-section {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto 60px;
    box-shadow: var(--shadow);
    text-align: center;
}

.install-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.emoji {
    font-size: 1.2em;
}

.install-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 24px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    background: var(--bg-light);
    color: var(--text-gray);
}

.tab-btn.active {
    background: var(--primary-red);
    color: white;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
}

.code-block code {
    color: #fbbf24;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: white;
}

.install-steps {
    text-align: left;
    padding-left: 24px;
    margin-bottom: 20px;
    color: var(--text-gray);
    font-size: 14px;
}

.install-steps li {
    margin-bottom: 8px;
}

.helper-text {
    color: var(--text-gray);
    font-size: 14px;
}

.link-red {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
}

.link-red:hover {
    text-decoration: underline;
}

/* Email Section */
.email-section {
    text-align: center;
    margin-bottom: 60px;
}

.pulse-dot {
    color: var(--primary-red);
    font-weight: 500;
    margin-bottom: 16px;
}

.email-form {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.email-input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.email-input:focus {
    border-color: var(--primary-red);
}

/* Feed Section */
.feed-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feed-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
}

.feed-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.feed-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.feed-content {
    flex: 1;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.feed-name {
    font-weight: 600;
    font-size: 15px;
}

.feed-time {
    font-size: 12px;
    color: var(--text-light);
}

.feed-text {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 12px;
}

.feed-actions {
    display: flex;
    gap: 16px;
}

.feed-actions button {
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.feed-actions button:hover {
    background: var(--bg-light);
    color: var(--primary-red);
}

.feed-actions button i {
    font-size: 14px;
}

/* Modal */
.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.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-gray);
    cursor: pointer;
}

.modal-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.modal-content h2 {
    margin-bottom: 8px;
}

.modal-content > p {
    color: var(--text-gray);
    margin-bottom: 24px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.input-group input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--primary-red);
}

.full-width {
    width: 100%;
}

.modal-footer {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-gray);
}

/* Chat Application */
.chat-app {
    height: 100vh;
    display: flex;
    background: var(--bg-light);
}

.chat-app.hidden {
    display: none;
}

/* Sidebar */
.chat-sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px 20px;
    background: var(--primary-red);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

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

.search-bar {
    padding: 8px 16px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar i {
    color: var(--text-light);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.chat-item:hover {
    background: var(--bg-light);
}

.chat-item.active {
    background: var(--bg-light);
}

.chat-item .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.chat-item .avatar.group-avatar {
    border-radius: 12px;
}

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

.chat-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-item-name {
    font-weight: 600;
    font-size: 16px;
}

.chat-item-time {
    font-size: 12px;
    color: var(--text-light);
}

.chat-item-preview {
    font-size: 14px;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.unread-badge {
    background: var(--primary-red);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
}

.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    text-align: center;
    padding: 40px;
}

.welcome-logo {
    width: 200px;
    height: 200px;
    margin-bottom: 32px;
    opacity: 0.9;
}

.chat-welcome h2 {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.chat-welcome p {
    color: var(--text-gray);
    max-width: 400px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container.hidden {
    display: none;
}

.chat-header {
    padding: 10px 16px;
    background: var(--primary-red);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-details h3 {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.user-details p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4d4d4' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.message {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.message.sent {
    align-self: flex-end;
    background: #d9fdd3;
    border-top-right-radius: 0;
}

.message.received {
    align-self: flex-start;
    background: white;
    border-top-left-radius: 0;
}

.message-sender {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    text-align: right;
    margin-top: 4px;
}

.message-input-area {
    padding: 10px 16px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-input-area .icon-btn {
    color: var(--text-gray);
}

.message-input-area .icon-btn:hover {
    background: var(--border-color);
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.send-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

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

/* Mobile Chat Modal */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.mobile-phone {
    width: 380px;
    height: 750px;
    background: #ece5dd;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 8px solid #1a1a1a;
}

.phone-status-bar {
    background: var(--primary-red);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.status-icons {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

.mobile-chat-header {
    background: var(--primary-red);
    padding: 12px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.back-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

.mobile-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

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

.mobile-user-info h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.mobile-user-info p {
    font-size: 12px;
    opacity: 0.9;
}

.mobile-header-actions {
    display: flex;
    gap: 4px;
}

.header-icon-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
}

/* Mobile Messages Area */
.mobile-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4c4a8' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.date-separator {
    text-align: center;
    margin: 8px 0;
}

.date-separator span {
    background: rgba(225, 213, 195, 0.9);
    color: #5f6d6d;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unread-separator {
    text-align: center;
    margin: 8px 12px;
}

.unread-separator span {
    background: #b2dbf7;
    color: #1f7cba;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 8px;
    display: inline-block;
}

.mobile-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    position: relative;
    line-height: 1.4;
}

.mobile-message.sent {
    align-self: flex-end;
    background: #d9fdd3;
    border-top-right-radius: 0;
}

.mobile-message.received {
    align-self: flex-start;
    background: white;
    border-top-left-radius: 0;
}

.mobile-message .sender-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mobile-message .msg-text {
    word-wrap: break-word;
}

.mobile-message .msg-time {
    font-size: 11px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.mobile-message.sent .msg-time .read-ticks {
    color: #53bdeb;
}

/* Mobile Input Area */
.mobile-input-area {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f2f5;
}

.mobile-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    background: white;
}

.input-icon-btn {
    background: transparent;
    border: none;
    color: #54656f;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.mic-btn {
    width: 48px;
    height: 48px;
    background: var(--primary-red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Phone Navigation Bar */
.phone-nav-bar {
    background: #1a1a1a;
    padding: 12px 0;
    display: flex;
    justify-content: center;
    gap: 60px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

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

/* Responsive */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        position: absolute;
        z-index: 100;
    }
    
    .chat-main {
        width: 100%;
    }
    
    .main-title {
        font-size: 32px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .agents-grid {
        grid-template-columns: 1fr;
    }
}
