/* SocialSouk — Islamic Social Commerce Design System */
:root {
    --green-deep:   #0a3d1f;
    --green-mid:    #1a5c33;
    --green-light:  #2d7a4a;
    --gold:         #d4af5a;
    --gold-dark:    #b8973b;
    --gold-light:   #f0d78a;
    --cream:        #faf7f2;
    --white:        #ffffff;
    --text:         #1a1a1a;
    --text-mid:     #555;
    --text-light:   #888;
    --border:       #e2ddd6;
    --shadow:       0 2px 16px rgba(0,0,0,.10);
    --shadow-lg:    0 8px 32px rgba(0,0,0,.15);
    --radius:       12px;
    --radius-sm:    8px;
    --transition:   .2s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--gold-dark); }

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

/* ── Navbar ── */
.navbar {
    background: var(--green-deep);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.nav-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -.3px;
}
.nav-brand span { color: var(--white); font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }

.nav-links a {
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    font-weight: 500;
    padding: .4rem .8rem;
    border-radius: 6px;
    transition: var(--transition);
}
.nav-links a:hover { background: rgba(255,255,255,.1); color: var(--gold); }

.nav-btn {
    background: var(--gold) !important;
    color: var(--green-deep) !important;
    font-weight: 700 !important;
    padding: .45rem 1.1rem !important;
    border-radius: 20px !important;
}
.nav-btn:hover { background: var(--gold-dark) !important; }

.nav-menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-menu-toggle span {
    display: block; width: 24px; height: 2px; background: var(--white); margin: 5px 0;
    transition: var(--transition);
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, #1a4a30 100%);
    color: var(--white);
    padding: 5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    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='%23ffffff' fill-opacity='0.03'%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");
}
.hero-content { position: relative; max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.1rem; opacity: .85; margin-bottom: 2rem; max-width: 520px; margin-left: auto; margin-right: auto; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem 1.6rem;
    border-radius: 25px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary   { background: var(--gold);        color: var(--green-deep); }
.btn-primary:hover { background: var(--gold-dark); color: var(--green-deep); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.6); }
.btn-secondary:hover { background: rgba(255,255,255,.1); color: var(--white); }
.btn-green     { background: var(--green-mid);   color: var(--white); }
.btn-green:hover { background: var(--green-light); color: var(--white); transform: translateY(-1px); }
.btn-outline   { background: transparent; color: var(--green-mid); border: 2px solid var(--green-mid); }
.btn-outline:hover { background: var(--green-mid); color: var(--white); }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Container ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Section ── */
.section { padding: 4rem 0; }
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green-deep);
    margin-bottom: .5rem;
}
.section-title span { color: var(--gold-dark); }
.section-sub { color: var(--text-mid); margin-bottom: 2.5rem; font-size: 1rem; }

/* ── Grid ── */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 1.5rem; }

/* ── Category Chips ── */
.category-grid { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2rem; }
.cat-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1.1rem;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}
.cat-chip:hover, .cat-chip.active {
    background: var(--green-deep);
    color: var(--gold);
    border-color: var(--green-deep);
}

/* ── Listing Card ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1.5px solid var(--border);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--gold); }

.card-img {
    width: 100%; height: 200px; object-fit: cover;
    background: linear-gradient(135deg, var(--green-deep), var(--green-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--gold);
    overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.1rem; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; color: var(--text); line-height: 1.3; }
.card-price { font-size: 1.15rem; font-weight: 700; color: var(--green-deep); margin-bottom: .4rem; }
.card-meta  { font-size: .8rem; color: var(--text-light); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-footer { padding: .8rem 1.1rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; }

.halal-badge {
    display: inline-flex; align-items: center; gap: .2rem;
    background: #e8f5e9; color: #2e7d32;
    font-size: .72rem; font-weight: 700; padding: .2rem .5rem;
    border-radius: 4px; border: 1px solid #a5d6a7;
    text-transform: uppercase; letter-spacing: .3px;
}

/* ── Auth Forms ── */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--green-deep) 0%, #1a4a30 100%);
    padding: 2rem;
}
.auth-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%; max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h2 { color: var(--green-deep); font-size: 1.6rem; font-weight: 800; }
.auth-logo p  { color: var(--text-light); font-size: .9rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-mid); margin-bottom: .4rem; }
.form-control {
    width: 100%; padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .95rem; color: var(--text);
    background: var(--cream); outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--green-mid); background: var(--white); box-shadow: 0 0 0 3px rgba(26,92,51,.1); }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-hint { font-size: .78rem; color: var(--text-light); margin-top: .3rem; }

/* ── Alerts / Flash ── */
.alert {
    padding: .9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
    font-size: .92rem;
    border-left: 4px solid;
}
.alert-success { background: #e8f5e9; color: #1b5e20; border-color: #4caf50; }
.alert-error   { background: #ffebee; color: #b71c1c; border-color: #f44336; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border-color: #2196f3; }
.alert-warning { background: #fff8e1; color: #e65100; border-color: #ff9800; }

/* ── Feed / Dashboard Layout ── */
.feed-layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 1.5rem;
    max-width: 1180px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    align-items: start;
}
.feed-sidebar, .feed-right { position: sticky; top: 80px; }

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border: 1.5px solid var(--border);
}
.sidebar-card h4 { font-size: .9rem; font-weight: 700; color: var(--green-deep); margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .5px; }

/* ── Profile ── */
.profile-header {
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    color: var(--white);
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.profile-avatar {
    width: 80px; height: 80px;
    background: var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700; color: var(--green-deep);
    margin: 0 auto 1rem;
    border: 3px solid var(--gold);
}
.profile-name { font-size: 1.5rem; font-weight: 700; }
.profile-city { opacity: .8; font-size: .9rem; margin-top: .3rem; }
.profile-stats { display: flex; gap: 2rem; justify-content: center; margin-top: 1.2rem; }
.stat-item { text-align: center; }
.stat-num  { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.stat-lbl  { font-size: .75rem; opacity: .7; }

/* ── Chat ── */
.chat-wrap {
    display: flex; height: calc(100vh - 64px);
    max-width: 1180px; margin: 0 auto;
}
.chat-list {
    width: 280px; border-right: 1px solid var(--border);
    overflow-y: auto; background: var(--white);
}
.chat-list-item {
    padding: 1rem; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
    display: flex; gap: .8rem; align-items: center;
}
.chat-list-item:hover, .chat-list-item.active { background: var(--cream); }
.chat-main  { flex: 1; display: flex; flex-direction: column; background: var(--cream); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 60%; padding: .7rem 1rem; border-radius: 16px; font-size: .9rem; line-height: 1.5; }
.msg-sent { background: var(--green-mid); color: var(--white); margin-left: auto; border-bottom-right-radius: 4px; }
.msg-recv { background: var(--white); color: var(--text); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.chat-input-bar { padding: 1rem; background: var(--white); border-top: 1px solid var(--border); display: flex; gap: .8rem; }
.chat-input { flex: 1; padding: .7rem 1rem; border: 1.5px solid var(--border); border-radius: 25px; outline: none; font-size: .95rem; }
.chat-input:focus { border-color: var(--green-mid); }

/* ── Dashboard ── */
.dashboard-wrap { max-width: 1000px; margin: 2rem auto; padding: 0 1.5rem; }
.dashboard-header {
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    color: var(--white); border-radius: var(--radius); padding: 1.8rem 2rem; margin-bottom: 1.5rem;
}
.dashboard-header h2 { font-size: 1.5rem; font-weight: 700; }
.dashboard-header p  { opacity: .8; font-size: .9rem; margin-top: .3rem; }

.tabs { display: flex; gap: 0; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.tab-btn {
    flex: 1; padding: .85rem; font-size: .9rem; font-weight: 600;
    background: none; border: none; cursor: pointer; color: var(--text-mid);
    border-bottom: 3px solid transparent; transition: var(--transition);
}
.tab-btn.active { color: var(--green-deep); border-bottom-color: var(--gold); background: var(--cream); }
.tab-btn:hover:not(.active) { background: var(--cream); }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { background: var(--green-deep); color: var(--gold); padding: .9rem 1rem; text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--cream); }

/* ── Status Badges ── */
.badge {
    display: inline-block; padding: .2rem .7rem;
    border-radius: 12px; font-size: .75rem; font-weight: 700; text-transform: uppercase;
}
.badge-active  { background: #e8f5e9; color: #2e7d32; }
.badge-pending { background: #fff8e1; color: #e65100; }
.badge-closed  { background: #f5f5f5; color: #757575; }
.badge-sold    { background: #fce4ec; color: #c62828; }

/* ── Footer ── */
footer {
    background: var(--green-deep);
    color: rgba(255,255,255,.75);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; max-width: 1180px; margin: 0 auto 2rem; }
.footer-brand { font-size: 1.3rem; font-weight: 700; color: var(--gold); margin-bottom: .5rem; }
.footer-brand p { font-size: .85rem; color: rgba(255,255,255,.6); font-weight: 400; }
.footer-heading { font-size: .8rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .8rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .88rem; transition: var(--transition); }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.2rem; font-size: .82rem; max-width: 1180px; margin: 0 auto; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-light); }
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-mid); margin-bottom: .5rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .feed-layout { grid-template-columns: 1fr; }
    .feed-sidebar, .feed-right { position: static; }
}
@media (max-width: 680px) {
    .nav-links { display: none; }
    .nav-menu-toggle { display: block; }
    .hero { padding: 3rem 1rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .chat-list { width: 80px; }
    .chat-list-item .chat-preview { display: none; }
    .auth-box { padding: 1.8rem; }
}
