/* public/css/style.css */

/* --- ✅ START ADDITION: Import Arabic Font --- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
/* --- ✅ END ADDITION --- */

/* --- Variables for Easy Theming (Light Mode) --- */
:root {
    --primary-color: #6a11cb;
    --primary-color-hover: #2575fc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --body-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --font-family: 'Poppins', sans-serif;
}

/* --- Global & Body Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--dark-color);
    margin: 0;
    padding-top: 85px; /* Space for fixed navbar */
    line-height: 1.6;
}

/* --- Main Container --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
    margin-top: auto;
}

/* --- Cards --- */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card-header {
    margin: -2rem -2rem 2rem -2rem;
    padding: 1.25rem 2rem;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.card-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

/* --- Forms & Buttons --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif; /* Added font */
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box; /* Fix for width overflow */
}

.btn-primary {
    color: #fff;
    background: linear-gradient(to right, var(--primary-color-hover), var(--primary-color));
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-block {
    display: block;
    width: 100%;
}

.is-invalid {
    border-color: var(--danger-color);
}
.invalid-feedback {
    color: var(--danger-color);
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* --- Alerts (Flash Messages) --- */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* --- Table Styles --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.75em;
    text-align: left;
    border: 1px solid #eee;
}

/* --- ✅ START FIX: Hide mobile labels on desktop --- */
table td::before {
    display: none;
}
/* --- ✅ END FIX --- */

th {
    background-color: #f8f9fa;
}

/* Responsive Tables */
@media screen and (max-width: 768px) {
    table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table tr {
        border-bottom: 3px solid #ddd;
        display: block;
        margin-bottom: .625em;
    }

    table td {
        border-bottom: 1px solid #ddd;
        display: block;
        font-size: 1rem; /* Increased Font Size */
        font-weight: 500; /* Bolder Text */
        text-align: right;
    }

    /* --- ✅ START FIX: Show mobile labels on mobile --- */
    table td::before {
        display: block;
        content: attr(data-label);
        float: left;
        font-weight: 700; /* Bolder Text */
        text-transform: uppercase;
    }
    /* --- ✅ END FIX --- */

    table td:last-child {
        border-bottom: 0;
    }
}