/**
 * Islamic Theme for Ez Al-Deen Quran Memorization Institute
 * Colors: Emerald Green (#2d8a4a), Gold (#d4af37), Dark Green (#1a5c3a)
 */

/* Import Arabic font */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

:root {
    --primary: #2d8a4a;
    --primary-dark: #1a5c3a;
    --secondary: #d4af37;
    --secondary-dark: #b8941f;
    --accent: #1a5c3a;
    --success: #2d8a4a;
    --info: #17a2b8;
    --warning: #d4af37;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --body-bg: #f8f9fa;
    --card-header-bg: linear-gradient(135deg, #2d8a4a 0%, #1a5c3a 100%);
}

/* ======================== */
/* Arabic Font for All Page */
/* ======================== */
body {
    font-size: 18px !important;
}
body,
body *:not(.la):not([class*="la-"]):not(i.la):not(span.la):not(i[class*="la-"]):not(span[class*="la-"]) {
    font-family: 'Amiri', 'Traditional Arabic', 'Simplified Arabic', serif !important;
}

/* Force Line Awesome icon font — must win over any Amiri override */
i.la,
span.la,
i[class*="la-"],
span[class*="la-"],
.la,
[class*="la-"] {
    font-family: 'Line Awesome Free', 'Line Awesome' !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    line-height: 1 !important;
    speak: none !important;
}

/* ======================== */
/* Bootstrap Color Overrides */
/* ======================== */
.bg-primary { background-color: #2d8a4a !important; }
.bg-success { background-color: #2d8a4a !important; }
.badge.bg-primary { background-color: #2d8a4a !important; }
.badge.bg-warning { background-color: #d4af37 !important; color: #2c3e50 !important; }

/* ======================== */
/* Navbar Brand Logo Gold   */
/* ======================== */
.navbar-brand,
.navbar-brand b,
.navbar-brand a,
a.navbar-brand,
.h2.text-decoration-none,
.h2.text-decoration-none b {
    color: #d4af37 !important;
}
.navbar-brand:hover,
.navbar-brand a:hover,
.h2.text-decoration-none:hover,
.h2.text-decoration-none:hover b {
    color: #b8941f !important;
}

.btn-primary {
    background-color: #2d8a4a !important;
    border-color: #2d8a4a !important;
}
.btn-primary:hover {
    background-color: #1a5c3a !important;
    border-color: #1a5c3a !important;
}

/* ======================== */
/* Sidebar Islamic Styling  */
/* ======================== */
.sidebar {
    background: linear-gradient(180deg, #2d8a4a 0%, #1a5c3a 100%) !important;
}
.sidebar .nav-link.active {
    background-color: rgba(212, 175, 55, 0.2) !important;
    border-right: 3px solid #d4af37 !important;
}
.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}
.navbar-nav .nav-link.active { color: #d4af37 !important; }

/* ======================== */
/* Card Headers              */
/* ======================== */
.card-header {
    background: linear-gradient(135deg, #2d8a4a 0%, #1a5c3a 100%);
    color: #ffffff;
    border-bottom: 3px solid #d4af37;
}

/* ======================== */
/* TABLE RTL + BEAUTIFICATION */
/* ======================== */

/* Table wrapper */
.table-responsive {
    direction: rtl;
    text-align: right;
}

/* Table container */
div.dataTables_wrapper {
    direction: rtl;
    text-align: right;
}

/* ALL table headers and cells */
table.dataTable thead tr th,
table.dataTable thead tr td,
table.dataTable tfoot tr th,
table.dataTable tfoot tr td,
table.dataTable tbody tr th,
table.dataTable tbody tr td,
.crud-table.table thead th,
.crud-table.table thead td,
.crud-table.table tbody th,
.crud-table.table tbody td,
.crud-table.table tfoot th,
.crud-table.table tfoot td {
    text-align: right !important;
    direction: rtl !important;
}

/* Table header styling */
table.dataTable thead tr th,
.crud-table.table thead th {
    background-color: #2d8a4a !important;
    color: #ffffff !important;
    border-color: #1a5c3a !important;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Zebra stripes */
.crud-table.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(45, 138, 74, 0.05) !important;
}

/* Row hover */
.crud-table.table-hover tbody tr:hover {
    background-color: rgba(45, 138, 74, 0.1) !important;
}

/* DataTables info text */
.dataTables_wrapper .dataTables_info {
    text-align: right !important;
    padding-right: 0.5rem;
}

/* Length dropdown */
.dataTables_wrapper .dataTables_length {
    text-align: right !important;
    float: right !important;
}

/* Search bar */
.dataTables_wrapper .dataTables_filter {
    text-align: right !important;
    float: left !important;
}
.dataTables_wrapper .dataTables_filter input {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate {
    text-align: left !important;
    float: left !important;
    direction: ltr;
}

/* Sorting icons fix for RTL */
table.dataTable thead > tr > th.dt-orderable-asc .dt-column-order,
table.dataTable thead > tr > th.dt-orderable-desc .dt-column-order,
table.dataTable thead > tr > th.dt-ordering-asc .dt-column-order,
table.dataTable thead > tr > th.dt-ordering-desc .dt-column-order {
    left: 0.5em;
    right: auto;
}

table.dataTable thead .dt-column-title {
    direction: rtl;
    text-align: right !important;
}

/* Actions column - keep LTR if needed */
td[data-action-column="true"] {
    direction: ltr !important;
    text-align: left !important;
}

/* ======================== */
/* Breadcrumbs               */
/* ======================== */
.breadcrumb {
    background-color: #f8f9fa;
    border-right: 4px solid #2d8a4a;
    direction: rtl;
}

/* ======================== */
/* Login Page                */
/* ======================== */
.login-page {
    background: linear-gradient(135deg, #2d8a4a 0%, #1a5c3a 100%) !important;
}
.btn-gold {
    background-color: #d4af37;
    border-color: #d4af37;
    color: #2c3e50;
}
.btn-gold:hover {
    background-color: #b8941f;
    border-color: #b8941f;
    color: #2c3e50;
}

/* ======================== */
/* Custom Scrollbar          */
/* ======================== */
::-webkit-scrollbar-track { background: #f8f9fa; }
::-webkit-scrollbar-thumb { background: #2d8a4a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1a5c3a; }

/* ======================== */
/* Age Groups Widget Centering */
/* ======================== */
.age-groups-card .card-body .row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.age-groups-card .card-body .row > .col-3 {
    flex: 0 0 auto;
    width: 25%;
    text-align: center;
}
.age-groups-card .card-body .row > .col-3 > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ======================== */
/* Teacher name gold badge  */
/* ======================== */
.badge.bg-success-lt {
    background-color: rgba(212, 175, 55, 0.15) !important;
    color: #d4af37 !important;
    font-size: 0.95em !important;
    font-weight: 700 !important;
    padding: 0.35em 0.75em !important;
}
