/* ===== TrueLovers Mobile App CSS ===== */
@import 'style.css';

/* ===== App Shell ===== */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--body-bg);
    padding-top: var(--top-bar-height);
    padding-bottom: var(--bottom-nav-height);
}

/* ===== Header ===== */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--top-bar-height);
    background: var(--secondary);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    z-index: 1500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-top: env(safe-area-inset-top, 0);
}

.header-left { display: flex; align-items: center; }
.header-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.header-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; color: var(--white);
    font-size: 20px; border-radius: 50%; cursor: pointer;
    transition: var(--transition);
}
.header-btn:active { background: rgba(255,255,255,0.15); }

.header-title {
    font-size: 17px; font-weight: 700; color: var(--white);
    display: flex; align-items: center; gap: 6px;
    flex: 1; text-align: center; justify-content: center;
}

.badge-dot {
    position: absolute; top: 6px; right: 6px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--primary); border: 2px solid var(--white);
}

/* ===== App Content ===== */
.app-content {
    flex: 1;
    padding: 12px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Drawer ===== */
.drawer-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 1800;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 80vw;
    background: var(--white); z-index: 1900;
    transform: translateX(-100%); transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: env(safe-area-inset-top, 0);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}
.drawer-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); object-fit: cover; }
.drawer-name { font-weight: 600; font-size: 15px; }
.drawer-email { font-size: 12px; opacity: 0.8; }

.drawer-nav { padding: 8px 0; }
.drawer-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; color: var(--gray-700);
    font-size: 14px; transition: var(--transition);
}
.drawer-item:active { background: var(--gray-50); }
.drawer-item.active { color: var(--primary); background: var(--primary-light); }
.drawer-item i { width: 20px; text-align: center; font-size: 16px; }

.drawer-badge {
    margin-left: auto;
    background: var(--primary); color: var(--white);
    font-size: 10px; padding: 1px 7px; border-radius: 10px;
    font-weight: 600;
}

.drawer-divider {
    padding: 12px 20px 4px;
    color: var(--gray-400);
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1500;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 0;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    min-width: 56px;
    border: none; background: none;
    cursor: pointer;
}
.tab-item i { font-size: 22px; transition: var(--transition); }
.tab-item.active { color: var(--primary); }
.tab-item.active i { transform: scale(1.05); }

.tab-item-center {
    margin-top: -20px;
}
.tab-logo {
    width: 76px; height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(231,76,60,0.35);
}

.tab-badge {
    position: absolute; top: 2px; right: 4px;
    background: var(--primary); color: var(--white);
    font-size: 9px; padding: 1px 5px; border-radius: 10px;
    min-width: 16px; text-align: center; font-weight: 600;
}

/* ===== Swipe Cards ===== */
.swipe-header { text-align: center; margin-bottom: 16px; }
.swipe-header h2 { font-size: 22px; }
.swipe-header p { font-size: 13px; }

.swipe-container {
    max-width: 400px; margin: 0 auto;
    min-height: 500px;
    position: relative;
}

.swipe-card {
    position: absolute; top: 0; left: 0; right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0; pointer-events: none;
    touch-action: pan-y;
}
.swipe-card.active { position: relative; opacity: 1; pointer-events: auto; }

.swipe-card-bg {
    height: 380px;
    position: relative;
    overflow: hidden;
}
.swipe-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.swipe-card-gradient {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.swipe-card-info {
    position: absolute; bottom: 14px; left: 16px; right: 16px;
    color: var(--white);
}
.swipe-card-info h3 { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.compat-badge { font-size: 12px; background: rgba(255,255,255,0.25); padding: 2px 10px; border-radius: 12px; font-weight: 600; backdrop-filter: blur(4px); }
.swipe-card-info p { font-size: 14px; opacity: 0.9; margin-top: 2px; }
.swipe-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.swipe-tags span {
    background: rgba(255,255,255,0.3);
    padding: 3px 12px; border-radius: 14px;
    font-size: 11px; font-weight: 500;
    backdrop-filter: blur(4px);
}

.swipe-card-details {
    padding: 14px 16px 16px;
    font-size: 13px; color: var(--text-color);
}
.swipe-detail-row {
    display: flex; gap: 16px; margin-top: 8px;
    font-size: 12px; color: var(--text-muted);
}
.swipe-detail-row i { width: 14px; }

/* Swipe badges */
.swipe-badge {
    position: absolute; top: 30px;
    font-size: 32px; font-weight: 800;
    padding: 8px 20px; border-radius: 8px;
    transform: rotate(-15deg);
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
}
.swipe-badge-like { left: 20px; color: var(--success); border: 4px solid var(--success); }
.swipe-badge-nope { right: 20px; color: var(--primary); border: 4px solid var(--primary); }

/* Swipe actions */
.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 20px 16px;
    margin-top: 440px;
}

.swipe-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none; cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.swipe-btn:active { transform: scale(0.9); }
.swipe-btn-nope { color: var(--primary); }
.swipe-btn-like { color: var(--success); }
.swipe-btn-info { color: var(--accent); }
.swipe-btn-chat { color: var(--primary); }
.swipe-btn-super { color: var(--warning); }

/* ===== Messages (Mobile) ===== */
.messages-container {
    display: flex;
    height: calc(100vh - var(--top-bar-height) - var(--bottom-nav-height) - 50px);
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.conversations-list {
    width: 320px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.conv-search {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}
.conv-search input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 13px;
}
.conv-search input:focus { border-color: var(--primary); }

.conversation-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-50);
    text-decoration: none;
    color: inherit;
}
.conversation-item:active { background: var(--gray-50); }
.conversation-item.active { background: var(--primary-light); }

.conversation-item img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 13px; }
.conv-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conv-meta { text-align: right; flex-shrink: 0; }
.conv-time { font-size: 10px; color: var(--text-muted); }
.unread-badge {
    display: inline-block;
    background: var(--primary); color: var(--white);
    font-size: 10px; padding: 1px 6px; border-radius: 10px;
    min-width: 18px; text-align: center; font-weight: 600;
    margin-top: 4px;
}

.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}
.chat-header img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.chat-user-info h5 { font-size: 14px; }
.chat-user-info small { font-size: 12px; color: var(--text-muted); }

.chat-unlocked-badge {
    margin-left: auto;
    font-size: 11px; color: var(--success);
    background: #d4edda; padding: 4px 12px;
    border-radius: 12px; white-space: nowrap;
}

.chat-messages {
    flex: 1; overflow-y: auto; padding: 14px;
    display: flex; flex-direction: column; gap: 8px;
}

.message {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 14px; line-height: 1.4;
}
.message.sent {
    align-self: flex-end;
    background: var(--primary); color: var(--white);
    border-bottom-right-radius: 4px;
}
.message.received {
    align-self: flex-start;
    background: var(--gray-50);
    border-bottom-left-radius: 4px;
}
.msg-time { font-size: 10px; opacity: 0.7; margin-top: 3px; display: block; }

.chat-input {
    display: flex; gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}
.chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
}
.chat-input input:focus { border-color: var(--primary); }
.chat-input button {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary); color: var(--white);
    border: none; cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.chat-payment-gate {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 30px 24px; text-align: center;
}
.chat-lock-icon {
    font-size: 56px; color: var(--primary);
    margin-bottom: 16px;
}
.chat-price-tag {
    background: var(--primary-light);
    padding: 12px 28px; border-radius: var(--radius);
    font-size: 28px; font-weight: 700; color: var(--primary);
    margin: 16px 0;
}
.chat-price-tag span { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.conv-toggle-bar {
    display: none;
    align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600; font-size: 14px;
}

/* ===== Page Enter Animation ===== */
.page-enter { animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive: Mobile Only ===== */
@media (max-width: 768px) {
    .app-content { padding: 0; }
    .swipe-container { max-width: 100%; padding: 0 12px; }
    .swipe-actions { margin-top: 400px; }
    .swipe-card-bg { height: 340px; }
    
    .messages-container { 
        border-radius: 0; 
        height: calc(100vh - var(--top-bar-height) - var(--bottom-nav-height));
        margin: 0;
    }
    .conversations-list { width: 100%; }
    .chat-area { display: none; }
    .chat-area.active { display: flex; }
    
    .conv-toggle-bar { display: flex; }
}

@media (max-width: 400px) {
    .swipe-card-bg { height: 280px; }
    .swipe-actions { margin-top: 340px; }
    .swipe-card-info h3 { font-size: 20px; }
    .compat-badge { font-size: 10px; padding: 1px 8px; }
}

/* ===== Profile Chat Bar ===== */
.profile-chat-bar {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 8px);
    left: 0; right: 0;
    padding: 8px 16px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
    background: linear-gradient(transparent, var(--body-bg) 30%);
    z-index: 500;
}

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 80px; left: 50%;
    transform: translateX(-50%);
    background: var(--dark); color: var(--white);
    padding: 10px 20px; border-radius: 25px;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
