/* =====================================================
   myMasjid Design System v2.0
   Facebook-inspired  •  Green brand  •  2026
   ===================================================== */

/* ---- SF Pro Font Faces ---- */
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-RegularItalic.otf') format('opentype'); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-MediumItalic.otf') format('opentype'); font-weight:500; font-style:italic; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Semibold.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-SemiboldItalic.otf') format('opentype'); font-weight:600; font-style:italic; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-BoldItalic.otf') format('opentype'); font-weight:700; font-style:italic; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Thin.otf') format('opentype'); font-weight:100; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Heavy.otf') format('opentype'); font-weight:800; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Display'; src:url('../fonts/SF-Pro-Display-Black.otf') format('opentype'); font-weight:900; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Text'; src:url('../fonts/SF-Pro-Text-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Text'; src:url('../fonts/SF-Pro-Text-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Text'; src:url('../fonts/SF-Pro-Text-Semibold.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face { font-family:'SF Pro Text'; src:url('../fonts/SF-Pro-Text-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
    /* Brand – myMasjid green */
    --mm-brand:        #8BC34A;
    --mm-brand-hover:  #7CB342;
    --mm-brand-dark:   #689F38;
    --mm-brand-deeper: #558B2F;
    --mm-brand-bg:     #f0fde8;
    --mm-brand-bg-hover: #e4fbcf;

    /* Neutrals – Facebook-inspired */
    --mm-bg:           #F0F2F5;
    --mm-surface:      #FFFFFF;
    --mm-surface-2:    #F7F8FA;
    --mm-border:       #E4E6EB;
    --mm-border-strong:#CED0D4;

    /* Text */
    --mm-text:         #1C1E21;
    --mm-text-2:       #65676B;
    --mm-text-3:       #8D949E;
    --mm-text-inv:     #FFFFFF;

    /* Navigation – top navbar (green bg) */
    --mm-nav-h:        56px;
    --mm-nav-bg:       #8BC34A;
    --mm-nav-border:   rgba(0,0,0,0.12);
    --mm-nav-text:     #FFFFFF;
    --mm-nav-text-sub: rgba(255,255,255,0.80);
    --mm-nav-active:   #FFFFFF;
    --mm-nav-active-bg:rgba(255,255,255,0.20);
    --mm-nav-hover-bg: rgba(255,255,255,0.15);

    /* Sidebar – white surface, separate active/hover tokens */
    --mm-sidebar-hover-bg:  #F0F2F5;
    --mm-sidebar-active-bg: #f0fde8;
    --mm-sidebar-active:    #3E7720;

    --mm-sidebar-w:    240px;
    --mm-right-w:      280px;

    /* Radius */
    --mm-r-xs:   4px;
    --mm-r-sm:   6px;
    --mm-r:      8px;
    --mm-r-md:   10px;
    --mm-r-lg:   12px;
    --mm-r-xl:   16px;
    --mm-r-2xl:  20px;
    --mm-r-full: 9999px;

    /* Shadows */
    --mm-sh-xs: 0 1px 2px rgba(0,0,0,0.08);
    --mm-sh:    0 2px 8px rgba(0,0,0,0.08);
    --mm-sh-md: 0 4px 16px rgba(0,0,0,0.10);
    --mm-sh-lg: 0 8px 32px rgba(0,0,0,0.12);

    /* Legacy compat */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    --font-text:    -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    --font-arabic:  'Noto Sans Arabic', 'Amiri', 'Traditional Arabic', serif;
}

/* =====================================================
   BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--mm-bg); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--mm-bg);
    color: var(--mm-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--mm-text);
    letter-spacing: -0.02em;
}

p { margin: 0 0 0.75rem; color: var(--mm-text-2); }
p:last-child { margin-bottom: 0; }

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar-glass {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--mm-nav-h);
    background: var(--mm-nav-bg);
    border-bottom: 1px solid var(--mm-nav-border);
    box-shadow: var(--mm-sh-xs);
    transition: transform 0.25s ease;
}
.navbar-glass.hidden-nav { transform: translateY(-100%); }

/* Nav links (top bar tabs) */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--mm-nav-text-sub);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--mm-r-sm);
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    text-decoration: none;
}
.nav-link:hover { background: var(--mm-nav-hover-bg); color: var(--mm-nav-text); }
.nav-link.active { background: var(--mm-nav-active-bg); color: var(--mm-nav-active); font-weight: 600; }

/* Icon action buttons (right side of nav) */
.navbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--mm-r-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mm-nav-text-sub);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
.navbar-action:hover { background: rgba(255,255,255,0.25); color: var(--mm-nav-text); }
.navbar-action-primary {
    background: rgba(255,255,255,0.25);
    color: var(--mm-nav-text);
    border-color: rgba(255,255,255,0.35);
}
.navbar-action-primary:hover { background: rgba(255,255,255,0.35); }

.navbar-action-wide {
    width: auto;
    padding: 0 0.75rem;
    gap: 0.5rem;
}

.navbar-mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--mm-r-sm);
    color: var(--mm-nav-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}
.navbar-mobile-btn:hover { background: var(--mm-nav-hover-bg); }

/* Search bar in navbar */
.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.navbar-search-input {
    height: 2.375rem;
    padding: 0 1rem 0 2.5rem;
    background: rgba(255,255,255,0.20);
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: var(--mm-r-full);
    font-size: 0.875rem;
    color: #fff;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
    width: 100%;
}
.navbar-search-input:focus {
    background: rgba(255,255,255,0.30);
    border-color: rgba(255,255,255,0.60);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
}
.navbar-search-input::placeholder { color: rgba(255,255,255,0.65); }
.navbar-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.65);
    pointer-events: none;
}

/* =====================================================
   APP SHELL LAYOUT  (Facebook 3-column)
   ===================================================== */
.mm-app-shell {
    display: flex;
    min-height: calc(100vh - var(--mm-nav-h));
}

/* Left sidebar: sticky navigation panel */
.mm-left-sidebar {
    position: sticky;
    top: var(--mm-nav-h);
    align-self: flex-start;
    width: var(--mm-sidebar-w);
    flex-shrink: 0;
    height: calc(100vh - var(--mm-nav-h));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.625rem 0.5rem;
    background: var(--mm-surface);
    border-right: 1px solid var(--mm-border);
    scrollbar-width: thin;
    scrollbar-color: var(--mm-border) transparent;
    display: flex;
    flex-direction: column;
}
.mm-left-sidebar::-webkit-scrollbar { width: 4px; }
.mm-left-sidebar::-webkit-scrollbar-track { background: transparent; }
.mm-left-sidebar::-webkit-scrollbar-thumb { background: var(--mm-border); border-radius: 2px; }

/* Center content + right sidebar wrapper */
.mm-content-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    gap: 0;
}

/* Center content column */
.mm-page-content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.25rem;
    max-width: 900px;
}

/* Right sidebar column */
.mm-right-sidebar {
    width: var(--mm-right-w);
    flex-shrink: 0;
    padding: 1rem 0.75rem;
    position: sticky;
    top: var(--mm-nav-h);
    height: calc(100vh - var(--mm-nav-h));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* Full-width content (no sidebar layout) */
.mm-full-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.5rem;
}

/* Keep full-width pages (including auth screens) inside narrow viewports. */
@media (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .mm-app-shell,
    .mm-content-wrap,
    .mm-full-content {
        width: 100%;
        max-width: 100%;
    }

    .mm-full-content {
        padding: 0.75rem;
    }
}

/* =====================================================
   LEFT SIDEBAR NAVIGATION LINKS
   ===================================================== */
/* User profile mini-card */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.625rem;
    border-radius: var(--mm-r-lg);
    text-decoration: none;
    color: var(--mm-text);
    transition: background 0.1s;
    margin-bottom: 0.25rem;
}
.sidebar-user-card:hover { background: var(--mm-sidebar-hover-bg); }

.sidebar-user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--mm-r-full);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--mm-brand-bg);
    display: grid;
    place-items: center;
    color: var(--mm-brand-dark);
    font-weight: 700;
    font-size: 0.9375rem;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mm-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-sub {
    font-size: 0.75rem;
    color: var(--mm-text-3);
    line-height: 1.2;
}

/* Navigation link (left sidebar) */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.625rem;
    border-radius: var(--mm-r-lg);
    color: var(--mm-text);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.1s, color 0.1s;
    text-decoration: none;
    white-space: nowrap;
}
.sidebar-nav-link:hover { background: var(--mm-sidebar-hover-bg); }
.sidebar-nav-link.active {
    background: var(--mm-sidebar-active-bg);
    color: var(--mm-sidebar-active);
    font-weight: 700;
}

.sidebar-nav-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: var(--mm-r-full);
    background: var(--mm-surface-2);
    flex-shrink: 0;
    color: var(--mm-text-2);
    transition: background 0.1s, color 0.1s;
}
.sidebar-nav-link:hover .sidebar-nav-icon { background: var(--mm-border); color: var(--mm-text); }
.sidebar-nav-link.active .sidebar-nav-icon { background: var(--mm-brand); color: #fff; }

/* Sidebar section divider */
.sidebar-divider { height: 1px; background: var(--mm-border); margin: 0.375rem 0; }
.sidebar-section-title {
    padding: 0.5rem 0.625rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mm-text-3);
}

/* Legacy sidebar-card / sidebar-link (right sidebar) */
.sidebar-card {
    background: var(--mm-surface);
    border-radius: var(--mm-r-lg);
    padding: 1rem;
    border: 1px solid var(--mm-border);
    margin-bottom: 0.75rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--mm-r);
    color: var(--mm-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.1s;
}
.sidebar-link:hover { background: var(--mm-sidebar-hover-bg); color: var(--mm-brand-dark); }
.sidebar-link.active { background: var(--mm-sidebar-active-bg); color: var(--mm-sidebar-active); font-weight: 600; }

/* =====================================================
   CARDS
   ===================================================== */
.mm-card {
    background: var(--mm-surface);
    border-radius: var(--mm-r-lg);
    border: 1px solid var(--mm-border);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.mm-card:hover { box-shadow: var(--mm-sh-md); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary-mm {
    background: var(--mm-brand);
    color: #fff;
    border-radius: var(--mm-r-sm);
    padding: 0.5rem 1.125rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary-mm:hover { background: var(--mm-brand-hover); box-shadow: 0 2px 8px rgba(139,195,74,0.25); color: #fff; }
.btn-primary-mm:active { background: var(--mm-brand-dark); }
.btn-primary-mm:disabled, .btn-primary-mm[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-outline-mm {
    background: transparent;
    color: var(--mm-brand-dark);
    border: 1.5px solid var(--mm-brand);
    border-radius: var(--mm-r-sm);
    padding: calc(0.5rem - 1.5px) 1.125rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    line-height: 1.4;
}
.btn-outline-mm:hover { background: var(--mm-brand-bg); color: var(--mm-brand-dark); }

.btn-ghost-mm {
    background: transparent;
    color: var(--mm-text-2);
    border-radius: var(--mm-r-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: none;
    text-decoration: none;
    line-height: 1.4;
}
.btn-ghost-mm:hover { background: var(--mm-sidebar-hover-bg); color: var(--mm-text); }

/* Navbar context: ghost = white text, primary = white button with green text */
.navbar-glass .btn-ghost-mm {
    color: rgba(255,255,255,0.88);
}
.navbar-glass .btn-ghost-mm:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.navbar-glass .btn-primary-mm {
    background: #fff;
    color: var(--mm-brand-dark);
    border: none;
}
.navbar-glass .btn-primary-mm:hover {
    background: rgba(255,255,255,0.90);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: var(--mm-brand-dark);
}

.btn-secondary-mm {
    background: var(--mm-surface-2);
    color: var(--mm-text);
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-r-sm);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    line-height: 1.4;
}
.btn-secondary-mm:hover { background: var(--mm-border); color: var(--mm-text); }

/* Auth page primary button */
.auth-primary-button {
    background: var(--mm-brand);
    border-color: var(--mm-brand);
    color: #fff;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.auth-primary-button:hover {
    background: var(--mm-brand-hover);
    border-color: var(--mm-brand-hover);
    box-shadow: 0 4px 12px rgba(139,195,74,0.3);
    color: #fff;
}
.auth-primary-button:active { background: var(--mm-brand-dark); border-color: var(--mm-brand-dark); }
.auth-primary-button:focus-visible { outline: 3px solid rgba(139,195,74,0.35); outline-offset: 3px; }

/* =====================================================
   FORM INPUTS
   ===================================================== */
.input-mm {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    border: 1.5px solid var(--mm-border-strong);
    border-radius: var(--mm-r);
    font-size: 0.9375rem;
    background: var(--mm-surface);
    color: var(--mm-text);
    transition: border-color 0.12s, box-shadow 0.12s;
    outline: none;
    font-family: inherit;
}
.input-mm:focus { border-color: var(--mm-brand); box-shadow: 0 0 0 3px rgba(139,195,74,0.15); }
.input-mm::placeholder { color: var(--mm-text-3); }
.input-mm:disabled { background: var(--mm-surface-2); cursor: not-allowed; opacity: 0.7; }

/* Force DaisyUI form elements to light mode */
.input, .input-bordered, .textarea, .textarea-bordered, .select, .select-bordered,
.input:focus, .textarea:focus, .select:focus {
    background-color: var(--mm-surface) !important;
    color: var(--mm-text) !important;
    border-color: var(--mm-border-strong) !important;
}
.label-text, .label-text-alt { color: #374151 !important; }

/* Bootstrap form overrides */
input.form-control, textarea.form-control, select.form-control, select.form-select {
    border: 1.5px solid var(--mm-border-strong);
    border-radius: var(--mm-r);
    padding: 0.5625rem 0.875rem;
    font-size: 0.9375rem;
    background: var(--mm-surface);
    color: var(--mm-text);
    transition: border-color 0.12s, box-shadow 0.12s;
}
input.form-control:focus, textarea.form-control:focus, select.form-control:focus, select.form-select:focus {
    border-color: var(--mm-brand);
    box-shadow: 0 0 0 3px rgba(139,195,74,0.15);
    outline: none;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge-mm {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--mm-r-full);
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green   { background: #dcfce7; color: #166534; }
.badge-gray    { background: var(--mm-surface-2); color: var(--mm-text-2); border: 1px solid var(--mm-border); }
.badge-amber   { background: #fef3c7; color: #92400e; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-blue    { background: #e0f2fe; color: #075985; }
.badge-primary { background: var(--mm-brand); color: #fff; font-weight: 700; }
.badge-brand   { background: var(--mm-brand); color: #fff; font-weight: 700; border-color: var(--mm-brand); }
.badge-brand-light { background: var(--mm-brand-bg); color: var(--mm-brand-dark); font-weight: 600; }

/* =====================================================
   FLASH / ALERT MESSAGES
   ===================================================== */
.flash-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8125rem 1rem;
    border-radius: var(--mm-r-md);
    margin-bottom: 0.625rem;
    font-size: 0.9rem;
    animation: mmSlideDown 0.25s ease;
    border: 1px solid transparent;
}
@keyframes mmSlideDown {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}
.flash-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-info    { background: #f0f9ff; color: #075985; border-color: #bae6fd; }

/* =====================================================
   DROPDOWN
   ===================================================== */
.dropdown-mm { position: relative; }
.dropdown-menu-mm {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--mm-surface);
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-r-lg);
    padding: 0.375rem;
    min-width: 180px;
    box-shadow: var(--mm-sh-md);
    z-index: 200;
}
.dropdown-mm:hover .dropdown-menu-mm,
.dropdown-mm.open .dropdown-menu-mm { display: block; }
.dropdown-item-mm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--mm-r);
    color: var(--mm-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.1s;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.dropdown-item-mm:hover { background: var(--mm-sidebar-hover-bg); color: var(--mm-text); }
.dropdown-item-mm.danger { color: #dc2626; }
.dropdown-item-mm.danger:hover { background: #fef2f2; }
.dropdown-divider-mm { height: 1px; background: var(--mm-border); margin: 0.25rem 0; }

/* =====================================================
   FOOTER
   ===================================================== */
.footer-mm { background: #1C1E21; color: #8D949E; padding: 3rem 0 1.5rem; }
.footer-mm a { color: #8D949E; text-decoration: none; font-size: 0.875rem; transition: color 0.12s; }
.footer-mm a:hover { color: #fff; }

/* =====================================================
   BACK TO TOP
   ===================================================== */
#back-to-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 40;
    background: var(--mm-brand); color: #fff;
    width: 2.5rem; height: 2.5rem; border-radius: var(--mm-r-full);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer; border: none;
    box-shadow: var(--mm-sh-md);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { transform: translateY(-2px); }

/* =====================================================
   PAGE HEADER UTILITY
   ===================================================== */
.mm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--mm-border);
}
.mm-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mm-text);
    letter-spacing: -0.02em;
    margin: 0;
}
.mm-page-subtitle {
    font-size: 0.875rem;
    color: var(--mm-text-2);
    margin: 0.25rem 0 0;
}

/* =====================================================
   MOBILE MENU OVERLAY
   ===================================================== */
.mm-mobile-drawer {
    display: none;
    position: fixed;
    inset: var(--mm-nav-h) 0 0 0;
    z-index: 90;
    background: rgba(0,0,0,0.5);
}
.mm-mobile-drawer.open { display: block; }
.mm-mobile-drawer-panel {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: min(var(--mm-sidebar-w), 80vw);
    background: var(--mm-surface);
    padding: 0.75rem 0.5rem;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--mm-border);
}
.mm-mobile-drawer.open .mm-mobile-drawer-panel { transform: translateX(0); }

/* =====================================================
   ADMIN PANEL BOOTSTRAP OVERRIDES
   (for Bootstrap 5 classes used in admin views)
   ===================================================== */
.admin-content .btn {
    font-size: 0.83rem;
    font-weight: 600;
    border-radius: var(--mm-r);
    border: none;
    transition: background 0.12s, box-shadow 0.12s;
    min-height: 2.25rem;
}
.admin-content .btn-primary,
.admin-content .btn-success {
    background: var(--mm-brand);
    color: #fff;
    border-color: var(--mm-brand);
}
.admin-content .btn-primary:hover,
.admin-content .btn-success:hover {
    background: var(--mm-brand-hover);
    color: #fff;
    border-color: var(--mm-brand-hover);
}
.admin-content .btn-secondary {
    background: var(--mm-surface-2);
    border-color: var(--mm-border);
    color: var(--mm-text);
}
.admin-content .btn-secondary:hover {
    background: var(--mm-border);
    color: var(--mm-text);
}
.admin-content .btn-danger  { background: #ef4444; border-color: #ef4444; color: #fff; }
.admin-content .btn-warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.admin-content .btn-info    { background: #e0f2fe; border-color: #bae6fd; color: #075985; }
.admin-content .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Generic Bootstrap .btn:hover override — do NOT apply to admin-content */
.btn:not(.btn-primary-mm):not(.btn-outline-mm):not(.btn-ghost-mm):not(.btn-secondary-mm) {
    /* let Bootstrap manage its own hover states */
}

/* Reset the global destructive override that was in old app.css */
/* (old: .btn:hover { color:#535612!important; background:#ffffff!important; }) */

/* Admin Bootstrap card */
.admin-content .card {
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-r-xl);
    background: var(--mm-surface);
    box-shadow: var(--mm-sh-xs);
}
.admin-content .card-header {
    padding: 1rem 1.25rem;
    background: var(--mm-surface-2);
    border-bottom: 1px solid var(--mm-border);
    font-weight: 600;
    color: var(--mm-text);
}
.admin-content .card-body { padding: 1.25rem; }
.admin-content .table { font-size: 0.875rem; color: var(--mm-text); }
.admin-content .table > :not(caption) > * > * { padding: 0.75rem 0.625rem; border-bottom-color: var(--mm-border); }
.admin-content .table thead th {
    color: var(--mm-text-2);
    background: var(--mm-surface-2);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-content .form-control:focus,
.admin-content .form-select:focus {
    border-color: var(--mm-brand);
    box-shadow: 0 0 0 3px rgba(139,195,74,0.15);
}
.admin-content .form-check-input:checked { background-color: var(--mm-brand); border-color: var(--mm-brand); }
.admin-content .badge { padding: 0.35rem 0.6rem; border-radius: var(--mm-r-full); font-size: 0.7rem; font-weight: 650; }
.admin-content .pagination { gap: 0.25rem; }
.admin-content .page-link { min-width: 2.25rem; border: 0; border-radius: var(--mm-r-sm) !important; color: var(--mm-brand-dark); text-align: center; }
.admin-content .page-item.active .page-link { background: var(--mm-brand); color: #fff; }
.admin-content .alert { border-radius: var(--mm-r-md); }
.admin-content .modal-content { border: 0; border-radius: var(--mm-r-xl); box-shadow: var(--mm-sh-lg); }

/* =====================================================
   GENEALOGY PAGE FACEBOOK-STYLE INPUTS
   ===================================================== */
.genealogy-page .input,
.genealogy-page .select {
    min-height: 2.75rem;
    height: 2.75rem;
    border-radius: var(--mm-r);
    background-color: var(--mm-surface-2) !important;
}
.genealogy-page .textarea { border-radius: var(--mm-r); background-color: var(--mm-surface-2) !important; }
.genealogy-page .input:focus,
.genealogy-page .select:focus,
.genealogy-page .textarea:focus {
    border-color: var(--mm-brand) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(139,195,74,0.15) !important;
}
.genealogy-page .label { min-height: 0; padding: 0.15rem 0 0.3rem; }
.genealogy-page .alert { min-height: 0; border-radius: var(--mm-r); padding: 0.75rem; }
.genealogy-page .btn:not(.btn-circle) { border-radius: var(--mm-r); }

/* =====================================================
   QURAN PAGE
   ===================================================== */
.arabic-text {
    font-family: var(--font-arabic);
    font-size: 2.75rem;
    color: var(--mm-text);
    font-weight: 700;
    display: block;
    line-height: 4.5rem;
}
.surah-number-badge {
    width: 46px; height: 46px;
    background: var(--mm-brand-bg);
    color: var(--mm-brand-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-weight: 700; font-size: 1rem;
}
.surah-card {
    background: var(--mm-surface);
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-r-lg);
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
}
.surah-card:hover { box-shadow: var(--mm-sh-md); border-color: var(--mm-brand); }

/* =====================================================
   FORUM-SPECIFIC
   ===================================================== */
.forum-topic-item {
    padding: 1rem 1.25rem;
    border-radius: var(--mm-r-lg);
    background: var(--mm-surface);
    border: 1px solid var(--mm-border);
    margin-bottom: 0.625rem;
    transition: box-shadow 0.15s;
}
.forum-topic-item:hover { box-shadow: var(--mm-sh); }
.forum-topic-item.pinned { border-left: 3px solid #D97706; }
.post-content { line-height: 1.6; word-wrap: break-word; color: var(--mm-text-2); }

.reaction-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.react-btn { font-size: 0.875rem; padding: 0.25rem 0.625rem; border-radius: var(--mm-r-full); transition: all 0.15s; }
.react-btn:hover { transform: translateY(-1px); }
.react-btn.active { background: var(--mm-brand); border-color: var(--mm-brand); color: #fff; }
.reaction-count { margin-left: 4px; font-size: 0.75rem; font-weight: 500; }

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes mmFadeIn {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}
.fade-in { animation: mmFadeIn 0.3s ease-out; }

@keyframes mmSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.fa-spinner, .spin { animation: mmSpin 1s linear infinite; }

/* =====================================================
   RTL SUPPORT
   ===================================================== */
[dir="rtl"] body { font-family: 'Noto Sans Arabic', sans-serif; }
[dir="rtl"] .mm-left-sidebar { border-right: none; border-left: 1px solid var(--mm-border); }
[dir="rtl"] .dropdown-menu-mm { right: auto; left: 0; }

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
:focus-visible {
    outline: 2px solid var(--mm-brand);
    outline-offset: 2px;
}
::selection { background: var(--mm-brand-bg); color: var(--mm-brand-dark); }

/* =====================================================
   MOBILE — remove page-content padding on small phones
   ===================================================== */
@media (max-width: 427px) {
    .mm-page-content, .mm-full-content { padding: 0; }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .navbar-glass, .mm-left-sidebar, .mm-right-sidebar, .footer-mm, #back-to-top { display: none !important; }
    body { background: #fff; }
    .mm-page-content, .mm-full-content { padding: 0; max-width: 100%; }
}
