/* ==========================================================================
   Edubaseforum — Premium Public Website Stylesheet
   Brand Identity: Classic Crimson Red (#C8102E), Editorial White & Dark Charcoal
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --brand-red: #C8102E;
    --brand-red-hover: #A50E26;
    --brand-red-dark: #8A0B20;
    --brand-red-subtle: #FDF2F4;
    --brand-red-border: #F8D7DA;
    --primary: #C8102E;
    --primary-rgb: 200, 16, 46;

    --bg-body: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-surface: #F1F3F5;
    --bg-input: #FFFFFF;
    --border-color: #E5E7EB;
    --border-subtle: #F3F4F6;
    --text-heading: #111827;
    --text-body: #374151;
    --text-muted: #6B7280;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);

    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #111418;
    --footer-text: #9CA3AF;
    --footer-heading: #FFFFFF;
}

[data-bs-theme="dark"] {
    --brand-red: #E02438;
    --brand-red-hover: #F04455;
    --brand-red-dark: #C8102E;
    --brand-red-subtle: rgba(200, 16, 46, 0.15);
    --brand-red-border: rgba(200, 16, 46, 0.3);
    --primary: #E02438;
    --primary-rgb: 224, 36, 56;

    --bg-body: #0E1217;
    --bg-card: #161B22;
    --bg-surface: #1E232B;
    --bg-input: #1A1F28;
    --border-color: #272E3D;
    --border-subtle: #1F2430;
    --text-heading: #F9FAFB;
    --text-body: #D1D5DB;
    --text-muted: #9CA3AF;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

    --header-bg: rgba(18, 22, 28, 0.95);
    --footer-bg: #090B0E;
    --footer-text: #8B949E;
    --footer-heading: #F0F6FC;
}

/* Base Document */
html {
    scroll-behavior: smooth;
    transition: background-color 0.25s ease, color 0.25s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.main-content {
    flex: 1 0 auto;
}

/* Editorial Typography */
.text-heading {
    color: var(--text-heading) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.02em;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
}

a {
    color: var(--brand-red);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--brand-red-hover);
}

/* Primary Crimson Buttons */
.btn-danger,
.btn-primary {
    background-color: var(--brand-red) !important;
    border-color: var(--brand-red) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger:hover,
.btn-primary:hover {
    background-color: var(--brand-red-hover) !important;
    border-color: var(--brand-red-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(200, 16, 46, 0.25);
}

.btn-outline-danger,
.btn-outline-primary {
    color: var(--brand-red) !important;
    border-color: var(--brand-red) !important;
    background-color: transparent !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-danger:hover,
.btn-outline-primary:hover {
    background-color: var(--brand-red) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

/* Header & Navigation */
.site-header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 1030;
    transition: all 0.2s ease;
}

.navbar-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    color: var(--text-heading) !important;
    text-decoration: none;
}

.navbar-brand-emblem {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(200, 16, 46, 0.35);
}

.navbar-nav .nav-link {
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--brand-red);
    background-color: var(--brand-red-subtle);
}

.navbar-nav .nav-link.active {
    color: var(--brand-red) !important;
    font-weight: 700;
    background-color: var(--brand-red-subtle);
}

/* Dark Mode Theme Switcher Pill */
.theme-switch-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-switch-btn:hover {
    color: var(--brand-red);
    border-color: var(--brand-red);
    transform: rotate(15deg);
}

/* Cards & Surfaces */
.card,
.forum-card,
.editorial-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm);
    color: var(--text-body);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-red) !important;
}

/* Category Cards */
.category-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    text-decoration: none;
    display: block;
    height: 100%;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--brand-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
    transition: all 0.2s ease;
}

.category-card:hover .category-card-icon {
    transform: scale(1.08);
}

/* Discussion Feed Cards (Reddit Inspired) */
.discussion-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    transition: all 0.15s ease;
}

.discussion-card:hover {
    border-color: #CBD5E1;
    background-color: var(--bg-card);
}

[data-bs-theme="dark"] .discussion-card:hover {
    border-color: #384252;
}

.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-surface);
    border-radius: 8px;
    min-width: 44px;
}

.vote-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    transition: color 0.15s ease, transform 0.1s ease;
}

.vote-btn:hover {
    color: var(--brand-red);
    transform: scale(1.15);
}

.vote-btn.active.upvote {
    color: #10B981 !important;
}

.vote-btn.active.downvote {
    color: var(--brand-red) !important;
}

.vote-score {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-heading);
    margin: 2px 0;
}

/* Marketplace Product Card */
.marketplace-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.marketplace-card:hover {
    border-color: var(--brand-red);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.marketplace-card-img {
    height: 170px;
    width: 100%;
    object-fit: cover;
    background-color: var(--bg-surface);
}

.price-pill {
    background: rgba(17, 24, 39, 0.85);
    color: #FFFFFF;
    backdrop-filter: blur(4px);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.25rem 0.65rem;
    border-radius: 50rem;
}

/* Badges & Pills */
.badge-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background-color: var(--brand-red-subtle);
    color: var(--brand-red);
    border: 1px solid var(--brand-red-border);
}

.badge-member-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    background-color: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
}

/* Form Inputs & Controls */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-body);
    border-radius: 10px;
    padding: 0.65rem 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-heading);
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.18);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #6B7280;
}

/* Classic Footer */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 5rem;
    padding: 4.5rem 0 2rem;
}

.footer-heading {
    color: var(--footer-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a {
    color: var(--footer-text);
    font-size: 0.9rem;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #FFFFFF;
    transform: translateX(2px);
}

.footer-social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.08);
    color: #D1D5DB;
    transition: all 0.2s ease;
}

.footer-social-icon:hover {
    background-color: var(--brand-red);
    color: #FFFFFF;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.75rem;
    margin-top: 3.5rem;
    font-size: 0.85rem;
}

/* Modals & Dropdowns in Dark Mode */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #161B22;
    border-color: #272E3D;
    color: #D1D5DB;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #D1D5DB;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #1F2430;
    color: #FFFFFF;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #161B22;
    border-color: #272E3D;
    color: #D1D5DB;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #D1D5DB;
    --bs-table-border-color: #272E3D;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #1F2430;
    --bs-table-color: #F0F6FC;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .site-header {
        padding: 0.65rem 0;
    }
    .navbar-collapse {
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        padding: 1.25rem;
        margin-top: 0.75rem;
        box-shadow: var(--shadow-lg);
    }
}

/* ==========================================================================
   STANDARDIZED PROFILE PHOTO & AVATAR SYSTEM
   Strict fixed frame dimensions, zero distortion, centered square crop
   ========================================================================== */

/* Universal Avatar Frame & Images */
.avatar-frame,
.member-avatar-frame,
.member-directory-avatar-frame {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    background: var(--bg-surface, #F1F5F9);
    vertical-align: middle;
}

.avatar-img,
.member-avatar-img,
.member-directory-avatar-img,
.avatar {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
}

/* 1. Member Directory Fixed Medium Size Frame (120 × 120 px) */
.member-directory-avatar-container {
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    margin: 0 auto 1rem auto;
    position: relative;
    flex-shrink: 0;
}

.member-directory-avatar-frame,
.member-card-avatar-120,
.avatar-120 {
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    border-radius: 50% !important;
    border: 3px solid rgba(56, 189, 248, 0.25) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.member-directory-card:hover .member-directory-avatar-frame {
    transform: scale(1.03);
    border-color: #38BDF8 !important;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.28) !important;
}

/* 2. Standardized Avatar Sizes Across Application */
.avatar-xl, .avatar-96 {
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    min-height: 96px !important;
    max-height: 96px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-lg, .avatar-72 {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-md, .avatar-56 {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-sm, .avatar-48 {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-xs, .avatar-40 {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-xxs, .avatar-32 {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.avatar-24 {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Fallback letter initials frame for members without photos */
.avatar-initials-120 {
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 2.75rem !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
}

/* Member Directory Card Styling */
.member-directory-card {
    border-radius: 18px;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E5E7EB);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.member-directory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

