/* assets/css/app.css */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lato:wght@300;400;700&display=swap');

:root {
    --primary:       #8B4513;
    --primary-dark:  #6B3410;
    --primary-light: #D2691E;
    --accent:        #C8860A;
    --bg:            #FDFAF6;
    --bg-card:       #FFFFFF;
    --text:          #2C2C2C;
    --text-muted:    #7A7A7A;
    --border:        #E8E0D5;
    --success:       #2E7D32;
    --error:         #C62828;
    --radius:        10px;
    --shadow:        0 2px 16px rgba(139,69,19,0.08);
}

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

body {
    font-family: 'Lato', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 0 20px; }

/* ── NAVBAR ── */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.navbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.navbar-logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: -0.3px;
}
.navbar-logo span { color: var(--accent); }
.navbar-nav { display: flex; align-items: center; gap: 8px; }
.navbar-nav a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all .2s;
    letter-spacing: 0.3px;
}
.navbar-nav a:hover { color: var(--primary); background: #FDF3EA; }
.navbar-nav a.active { color: var(--primary); }
.badge {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── BUTTONS ── */
.btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-align: center;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #a86f08; color: #fff; }
.btn-lg { padding: 14px 36px; font-size: 17px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: 'Lato', sans-serif;
    background: #fff;
    color: var(--text);
    transition: border-color .2s;
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}
.form-control::placeholder { color: #bbb; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B4513' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-body { padding: 28px; }
.card-title { font-size: 22px; margin-bottom: 6px; }
.card-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ── MEMBER GRID ── */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.member-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.member-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(139,69,19,0.12); }
.member-card-photo {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #f0e8df;
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-card-photo .no-photo {
    font-size: 56px;
    color: #d4c4b5;
}
.member-card-info { padding: 14px; }
.member-card-name { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; }
.member-card-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.member-card-actions { padding: 0 14px 14px; display: flex; gap: 8px; }

/* ── HERO ── */
.hero {
    background: linear-gradient(135deg, #FDF6EE 0%, #F5E6D3 100%);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(139,69,19,0.05);
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(200,134,10,0.06);
}
.hero-title { font-size: clamp(36px, 5vw, 58px); color: var(--primary); margin-bottom: 16px; }
.hero-title em { color: var(--accent); font-style: italic; }
.hero-subtitle { font-size: 18px; color: var(--text-muted); max-width: 520px; margin: 0 auto 36px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── AUTH PAGES ── */
.auth-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #FDF6EE 0%, #F5E6D3 100%);
}
.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 44px 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(139,69,19,0.12);
}
.auth-logo {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 6px;
}
.auth-logo span { color: var(--accent); }
.auth-tagline { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.auth-divider { text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 13px; position: relative; }
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── FLASH MESSAGES ── */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
}
.flash-success { background: #E8F5E9; color: var(--success); border: 1px solid #A5D6A7; }
.flash-error   { background: #FFEBEE; color: var(--error);   border: 1px solid #EF9A9A; }
.flash-info    { background: #FFF8E1; color: #F57F17;        border: 1px solid #FFE082; }

/* ── PROFILE PAGE ── */
.profile-hero { display: flex; gap: 32px; align-items: flex-start; padding: 40px 0; flex-wrap: wrap; }
.profile-photo-main {
    width: 220px; height: 280px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    background: #f0e8df;
}
.profile-info { flex: 1; min-width: 240px; }
.profile-name { font-size: 34px; margin-bottom: 6px; }
.profile-meta { color: var(--text-muted); font-size: 15px; margin-bottom: 20px; }
.profile-bio { font-size: 16px; line-height: 1.75; color: var(--text); margin-bottom: 24px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.profile-tag {
    background: #FDF3EA;
    color: var(--primary);
    border: 1px solid #F0D9C3;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}
.profile-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.profile-photos img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 10px; cursor: pointer;
}

/* ── MESSAGES ── */
.inbox-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.inbox-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    cursor: pointer;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: #FDF3EA; }
.inbox-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0e8df;
    flex-shrink: 0;
}
.inbox-name { font-weight: 700; font-size: 15px; }
.inbox-preview { font-size: 13px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.inbox-time { font-size: 12px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.inbox-unread .inbox-name { color: var(--primary); }

.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 180px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 68%; }
.msg-in  { align-self: flex-start; }
.msg-out { align-self: flex-end; }
.msg-bubble {
    padding: 11px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
}
.msg-in  .msg-bubble { background: #F3EAE0; color: var(--text); border-bottom-left-radius: 4px; }
.msg-out .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }
.msg-out .msg-time { text-align: right; }
.chat-input-wrap { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; background: #fff; }
.chat-input { flex: 1; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 24px; font-size: 15px; font-family: 'Lato', sans-serif; outline: none; }
.chat-input:focus { border-color: var(--primary); }

/* ── UPGRADE PAGE ── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 40px 0; }
.pricing-card {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: all .2s;
}
.pricing-card.featured { border-color: var(--primary); box-shadow: 0 8px 32px rgba(139,69,19,0.15); transform: scale(1.03); }
.pricing-card .plan-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; }
.pricing-card .plan-price { font-family: 'Playfair Display', serif; font-size: 42px; color: var(--primary); font-weight: 600; }
.pricing-card .plan-price sup { font-size: 20px; vertical-align: super; }
.pricing-card .plan-period { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.pricing-card ul { list-style: none; margin-bottom: 28px; text-align: left; }
.pricing-card ul li { padding: 6px 0; font-size: 14px; color: var(--text); }
.pricing-card ul li::before { content: '✓  '; color: var(--success); font-weight: 700; }
.plan-badge { background: var(--primary); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 700; margin-bottom: 12px; display: inline-block; }

/* ── FOOTER ── */
.footer {
    background: #2C1810;
    color: #B89880;
    padding: 40px 20px;
    margin-top: 80px;
    font-size: 14px;
    text-align: center;
}
.footer a { color: #D2A882; }
.footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.py-4 { padding-top: 32px; padding-bottom: 32px; }
.py-5 { padding-top: 48px; padding-bottom: 48px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }

/* ── PREMIUM BLUR (free users see blurred content) ── */
.premium-blur { filter: blur(6px); pointer-events: none; user-select: none; }
.premium-gate {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
.premium-gate-overlay {
    position: absolute; inset: 0;
    background: rgba(253,246,238,0.85);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border-radius: var(--radius);
    text-align: center;
    padding: 20px;
}
.premium-gate-overlay h3 { font-size: 20px; color: var(--primary); margin-bottom: 8px; }
.premium-gate-overlay p  { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .navbar-nav a span { display: none; }
    .auth-card { padding: 32px 24px; }
    .profile-hero { flex-direction: column; }
    .profile-photo-main { width: 100%; height: 280px; }
    .pricing-card.featured { transform: none; }
    .member-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .hero { padding: 56px 20px; }
}

/* ── AI MESSAGE COACH ── */
.ai-coach {
    background: linear-gradient(135deg, #FDF6EE, #F5E6D3);
    border: 1px solid #E8D5BC;
    border-radius: 16px;
    padding: 20px 20px 16px;
    margin: 12px 16px;
}
.ai-coach-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.ai-suggestion {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 10px;
    transition: all .2s;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(139,69,19,0.06);
}
.ai-suggestion:hover {
    border-color: var(--primary);
    background: #FDF6EE;
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(139,69,19,0.12);
}
.ai-suggestion:last-child { margin-bottom: 0; }
.ai-suggestion-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.ai-suggestion-text { flex: 1; }
.ai-suggestion-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.ai-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.ai-loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}
@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}
.coach-score {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--border);
}
.coach-score-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.coach-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .5s ease;
}
.score-excellent { background: #2E7D32; }
.score-great     { background: #558B2F; }
.score-good      { background: #F57F17; }
.score-okay      { background: #E65100; }
.score-bad       { background: #C62828; }
