/* ===== HeartLink Global Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #e84393;
    --primary-dark: #d63384;
    --primary-light: #fd79a8;
    --secondary: #6c5ce7;
    --accent: #00cec9;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #dfe6e9;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Layout ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-card);
    position: relative;
}

@media (min-width: 768px) {
    .app-container {
        max-width: 100%;
    }
}

.page { padding-bottom: 80px; }

/* ===== Top Navigation ===== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.top-nav .logo span { color: var(--secondary); }

.top-nav .nav-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.top-nav .nav-actions { display: flex; gap: 12px; align-items: center; }

.nav-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg);
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
    color: var(--text);
    transition: all 0.2s;
    position: relative;
}

.nav-icon:hover { background: var(--primary-light); color: white; }

.nav-icon .badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}

/* ===== Bottom Tab Bar ===== */
.tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 100;
}

@media (min-width: 768px) {
    .tab-bar { max-width: 100%; }
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
}

.tab-item .tab-icon { font-size: 1.4rem; }
.tab-item.active { color: var(--primary); }
.tab-item:hover { color: var(--primary); }

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-body { padding: 16px; }

/* ===== Profile Cards (Discover) ===== */
.profile-card {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.profile-card .photo {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
}

.profile-card .photo-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
}

.profile-card .info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.profile-card .info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-card .info .detail {
    font-size: 0.9rem;
    opacity: 0.9;
}

.profile-card .info .location {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-top: 4px;
}

/* ===== Action Buttons (Like/Pass) ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px;
}

.btn-action {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-pass {
    background: white;
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-pass:hover { background: var(--danger); color: white; }

.btn-like {
    background: var(--primary);
    color: white;
}

.btn-like:hover { background: var(--primary-dark); transform: scale(1.1); }

.btn-superlike {
    background: var(--secondary);
    color: white;
}

.btn-superlike:hover { background: #5b4cdb; transform: scale(1.1); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-danger { background: var(--danger); color: white; }

.btn-success { background: var(--success); color: white; }

.btn-block { width: 100%; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-lg { padding: 16px 32px; font-size: 1.1rem; }

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--bg-card);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23636e72' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Chat Bubbles ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
}

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

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: var(--bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-bubble .time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.chat-input-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.chat-input-bar input:focus { border-color: var(--primary); }

.chat-input-bar button {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-input-bar button:hover { background: var(--primary-dark); }

/* ===== Match List ===== */
.match-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

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

.match-item .avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.5rem;
    flex-shrink: 0;
}

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

.match-item .match-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-item .match-info .last-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-item .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.match-item .unread-dot {
    width: 10px; height: 10px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
}

/* ===== Profile Page ===== */
.profile-header {
    text-align: center;
    padding: 24px 16px;
}

.profile-header .avatar-large {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 2.5rem;
    border: 3px solid var(--primary);
}

.profile-header h2 { font-size: 1.3rem; }
.profile-header .subtitle { color: var(--text-light); font-size: 0.9rem; }

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px;
    margin: 0 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
}

.profile-stats .stat { text-align: center; }
.profile-stats .stat .num { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.profile-stats .stat .label { font-size: 0.75rem; color: var(--text-muted); }

.profile-menu {
    padding: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text);
}

.menu-item:hover { background: var(--bg); }
.menu-item .menu-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.menu-item .menu-text { flex: 1; font-weight: 500; }
.menu-item .menu-arrow { color: var(--text-muted); }

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #fce4ec, #f3e5f5, #e8eaf6);
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
}

.auth-card .auth-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-card .auth-logo span { color: var(--secondary); }

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.auth-link a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 60px 24px;
    background: linear-gradient(135deg, #fce4ec, #f3e5f5);
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 360px;
    margin: 0 auto 24px;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

.loading-spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-light); margin-bottom: 8px; }

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--secondary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Photo Grid ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

/* ===== Interest Tags ===== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.tag.active {
    background: var(--primary);
    color: white;
}

/* ===== Announcement Banner ===== */
.announcement-bar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.announcement-bar a {
    color: white;
    text-decoration: underline;
}

/* ===== Image Upload ===== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-area:hover { border-color: var(--primary); }
.upload-area .upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-area p { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Responsive ===== */
@media (min-width: 768px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}
