﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --bg-dark: #0f0a19;
    --card-bg: rgba(28, 19, 43, 0.85);
    --pink-primary: #ff2a85;
    --pink-hover: #e01b70;
    --purple-accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-soft: rgba(255, 42, 133, 0.25);
}

body {
    background: radial-gradient(circle at top right, #2e1035, var(--bg-dark) 60%);
    color: var(--text-main);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 10, 25, 0.9);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pink-primary);
    letter-spacing: 0.5px;
}

.logo span {
    color: var(--text-main);
    font-weight: 400;
    font-size: 1rem;
}

#navLinks {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 42, 133, 0.15);
    color: var(--pink-primary);
    border-color: var(--pink-primary);
}

.nav-btn.logout {
    color: #f87171;
}

.nav-btn.logout:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
}

/* Main Container */
.main-container {
    max-width: 1050px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cards & Forms */
.card {
    max-width: 460px;
    margin: 2rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--pink-primary), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.85rem 0 0.35rem;
    font-weight: 600;
}

input,
textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease;
}

input:focus,
textarea:focus {
    border-color: var(--pink-primary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
}

.primary-btn,
.secondary-btn {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: transform 0.15s ease, background 0.25s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--pink-primary), var(--purple-accent));
    color: #fff;
}

.primary-btn:hover {
    background: linear-gradient(135deg, var(--pink-hover), #7c3aed);
    transform: translateY(-1px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}

.secondary-btn:hover {
    background: rgba(255, 42, 133, 0.15);
}

.full-width {
    width: 100%;
    margin-top: 1.25rem;
}

.error-msg {
    color: #fb7185;
    font-size: 0.88rem;
    margin-top: 0.85rem;
    text-align: center;
}

.status-msg {
    color: #4ade80;
    font-size: 0.88rem;
    margin-top: 0.85rem;
    text-align: center;
}

/* Discover Grid & Profile Cards */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}

.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease;
}

.profile-card:hover {
    transform: translateY(-4px);
}

.profile-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #1e152a;
}

.profile-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.4rem;
}

.profile-bio {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
    line-height: 1.4;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.tag {
    background: rgba(255, 42, 133, 0.15);
    color: #ff85b3;
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 42, 133, 0.3);
}

.like-btn {
    margin-top: auto;
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--pink-primary), var(--purple-accent));
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Matches & 10-Message Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    overflow: hidden;
    height: 75vh;
}

.matches-sidebar {
    border-right: 1px solid var(--border-soft);
    padding: 1.2rem;
    overflow-y: auto;
}

.matches-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--pink-primary);
}

#matchesList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.match-item:hover,
.match-item.active {
    background: rgba(255, 42, 133, 0.18);
}

.match-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--pink-primary);
}

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.counter-badge {
    background: rgba(255, 42, 133, 0.2);
    color: #ff85b3;
    border: 1px solid var(--pink-primary);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.messages-box {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.msg-bubble {
    max-width: 72%;
    padding: 0.65rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg-sent {
    background: linear-gradient(135deg, var(--pink-primary), var(--purple-accent));
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.msg-received {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.unlock-box {
    margin: 1rem;
    padding: 1.25rem;
    background: rgba(255, 42, 133, 0.12);
    border: 1px dashed var(--pink-primary);
    border-radius: 14px;
    text-align: center;
}

.unlock-box h4 {
    color: #ff85b3;
    margin-bottom: 0.35rem;
}

.insta-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.65rem 1.4rem;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 999px;
}

.chat-input-area {
    display: flex;
    gap: 0.65rem;
    padding: 1rem;
    border-top: 1px solid var(--border-soft);
}

.send-btn {
    padding: 0 1.4rem;
    background: var(--pink-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
        height: 82vh;
    }
    .matches-sidebar {
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
    }
}