/* =====================================================
   UMMAH HUB – GLOBAL THEME VARIABLES
===================================================== */
:root {
    --primary: #1b5e20;        /* Mosque main color */
    --primary-light: #2e7d32;
    --bg: #f4f7f5;
    --card: #ffffff;
    --text: #333333;
    --muted: #777777;
    --border: #e0e0e0;
    --nav-text: #ffffff;
    --success-bg: #e8f5e9;
    --error-bg: #ffebee;
}

/* ================= DARK MODE ================= */
body.dark {
    --bg: #121212;
    --card: #1e1e1e;
    --text: #e0e0e0;
    --muted: #aaaaaa;
    --border: #333333;
    --primary: #81c784;
    --primary-light: #a5d6a7;
    --nav-text: #e0e0e0;
    --success-bg: #1b3a1b;
    --error-bg: #3a1b1b;
}

/* ================= RTL (ARABIC) ================= */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: "Tahoma", "Arial", sans-serif;
}

/* =====================================================
   BASE
===================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, sans-serif;
}

h1, h2, h3 {
    color: var(--primary);
    margin-top: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

/* =====================================================
   LAYOUT
===================================================== */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

/* =====================================================
   NAVBAR
===================================================== */
nav {
    background: var(--primary);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

nav .brand {
    display: flex;
    align-items: center;
    color: var(--nav-text);
    font-weight: bold;
}

nav .brand img {
    height: 36px;
    margin-right: 10px;
}

body.rtl nav .brand img {
    margin-right: 0;
    margin-left: 10px;
}

nav a {
    color: var(--nav-text);
    margin: 6px 10px;
    display: inline-block;
}

nav a:hover {
    color: #c8e6c9;
}

/* =====================================================
   CARDS
===================================================== */
.card {
    background: var(--card);
    border-radius: 10px;
    padding: 20px;
    margin: 15px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* =====================================================
   FORMS
===================================================== */
form label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* =====================================================
   BUTTONS
===================================================== */
button {
    margin-top: 15px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

button:hover {
    background: var(--primary-light);
}

/* =====================================================
   TABLES
===================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}

th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
}

body.rtl th {
    text-align: right;
}

td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: rgba(0,0,0,0.03);
}

/* =====================================================
   AVATARS / IMAGES
===================================================== */
.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* =====================================================
   ALERTS
===================================================== */
.success {
    background: var(--success-bg);
    color: var(--primary);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.error {
    background: var(--error-bg);
    color: #c62828;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

/* =====================================================
   LOGIN PAGE
===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #e8f5e9, #ffffff);
}

body.dark.login-page {
    background: linear-gradient(to bottom, #1e1e1e, #121212);
}

.login-box {
    width: 100%;
    max-width: 380px;
}

.login-title {
    text-align: center;
    font-size: 22px;
    margin-bottom: 15px;
}

/* =====================================================
   FAMILY VIEW
===================================================== */
.family-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.family-list li {
    list-style: none;
    padding: 6px 0;
}

/* =====================================================
   ATTENDANCE
===================================================== */
.attendance-list label {
    display: block;
    padding: 6px 0;
}

/* =====================================================
   FOOTER
===================================================== */
.footer {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 30px;
}

/* =====================================================
   MOBILE RESPONSIVE
===================================================== */
@media (max-width: 768px) {

    nav {
        flex-direction: column;
        align-items: flex-start;
    }

    nav a {
        margin: 6px 0;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    th {
        display: none;
    }

    td {
        padding: 10px;
        border: none;
        position: relative;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
        color: var(--primary);
    }
}
