/*=============================================================
    Library Management System - Fikr&Binaa Visual Identity
    Design System: Educational, Institutional, Calm, Clean
    Updated: Blue Gradient Theme
    ========================================================  */

/* =============================================================
   COLOR PALETTE & CSS VARIABLES
 ============================================================ */
:root {
    /* Brand Colors (Blue Theme) */
    --primary-blue: #126698;
    --secondary-blue: #2980b9;
    --primary-gradient: linear-gradient(135deg, #126698 0%, #2980b9 100%);
    --header-gradient: linear-gradient(to right, #126698, #6dd5fa, #ffffff);

    /* Semantic Colors */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Backgrounds & Text */
    --main-bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --primary-text: #f48120;
    --secondary-text: #7F8C8D;
    --muted-text: #95A5A6;
    --border-color: #E0E0E0;
}

/* Professional UI refinement layer */
body {
    color: #263241 !important;
}
h1,
h2,
h3,
h4,
h5,
h6,
.header-line {
    color: #17324d;
    letter-spacing: 0;
}
.header-line {
    display: block;
    border-bottom: 1px solid #dbe3ec;
    padding-bottom: 14px;
    margin-bottom: 22px;
}
p,
td,
th,
label,
.panel-body,
.book-meta-item,
.text-muted {
    color: #334155;
}
.panel,
.book-card-horizontal,
.suggestion-card {
    border: 1px solid #e5ebf2;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}
.panel-heading {
    background: #f8fafc !important;
    color: #17324d !important;
    border-color: #e5ebf2 !important;
}
.btn-primary,
.btn-info {
    background: #126698;
    border-color: #126698;
    color: #fff !important;
}
.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
    background: #0f557e;
    border-color: #0f557e;
    color: #fff !important;
}
.btn-default {
    background: #fff;
    border-color: #cfd8e3;
    color: #334155 !important;
}
.btn-default:hover {
    background: #f8fafc;
    border-color: #b8c4d2;
}
.alert {
    border: 1px solid transparent;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.alert-warning {
    background: #fff8e6 !important;
    border-color: #f4d27b !important;
    color: #694b00 !important;
}
.alert-info {
    background: #eef8ff !important;
    border-color: #a8d8f5 !important;
    color: #164b68 !important;
}
.empty-state h4,
.empty-state p {
    color: #526170;
}
.book-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1) !important;
}
.book-image-container {
    border-left: 1px solid #e5ebf2;
}
.book-title {
    color: #17324d !important;
}
.form-control,
.select2-container--default .select2-selection--single {
    border-color: #cfd8e3 !important;
}
@media (max-width: 767px) {
    .panel-body {
        padding: 16px;
    }
    .header-line {
        font-size: 1.25rem;
    }
    .btn {
        width: auto;
        white-space: normal;
    }
}

/* Stabilization UI pass */
body {
    background: #f5f7fb;
    color: #263241;
    line-height: 1.7;
}
.content-wrapper {
    padding-top: 28px;
    padding-bottom: 36px;
}
.panel {
    border-radius: 8px;
    border-color: #e6ebf2;
    box-shadow: 0 8px 24px rgba(20, 35, 55, 0.06);
}
.panel-heading {
    border-radius: 8px 8px 0 0;
    font-weight: 700;
}
.form-control,
.form-control1,
select,
textarea {
    border-radius: 6px !important;
    border-color: #d8e0ea;
    min-height: 38px;
}
.form-control:focus,
textarea:focus {
    border-color: #126698;
    box-shadow: 0 0 0 3px rgba(18, 102, 152, 0.12);
}
.btn {
    border-radius: 6px;
    font-weight: 600;
    min-height: 36px;
}
.btn-xs {
    min-height: 28px;
}
.badge {
    border-radius: 10px;
}
.table-responsive {
    border-radius: 8px;
    border-color: #e6ebf2;
}
.table > thead > tr > th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}
.alert {
    border-radius: 8px;
}
.empty-state {
    text-align: center;
    padding: 42px 20px;
    color: #7b8794;
}
.empty-state i {
    display: block;
    font-size: 38px;
    margin-bottom: 12px;
}
@media (max-width: 767px) {
    .content-wrapper {
        padding-top: 18px;
    }
    #menu-top li a,
    .btn {
        min-height: 42px;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =============================================================
   GENERAL STYLES
 ============================================================ */

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--primary-text);
    background-color: var(--main-bg);
    font-size: 16px;
    direction: rtl;
    text-align: right;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #f48120 !important;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
}

h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cairo', Arial, sans-serif;
    color: var(--primary-text);
    margin-top: 0;
}

.set-radius-zero {
    border-radius: 0;
}

.content-wrapper {
    margin-top: 40px;
    min-height: 800px;
    padding-bottom: 90px;
    background-color: var(--main-bg);
}

@media (max-width: 768px) {
    .content-wrapper {
        margin-top: 20px;
        padding-bottom: 60px;
    }
}

.header-line {
    font-weight: 700;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    color: #f48120;
    font-size: 1.5rem;
    margin-bottom: 30px;
    display: inline-block;
}

.pad-botm {
    padding-bottom: 30px;
}

/* =============================================================
   NAVBAR & MENU STYLES
 ============================================================ */

.navbar-inverse {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar {
    min-height: 90px;
    margin-bottom: 0;
}

.logo-img {
    height: 65px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
    border-color: transparent;
}

.navbar-toggle {
    background-color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.navbar-toggle .icon-bar {
    background-color: var(--card-bg);
}

.right-div {
    float: left;
    padding: 20px;
}

#menu-top a {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 600;
    /* Bold for readability */
    padding: 25px 15px;
    text-transform: uppercase;
    font-size: 1.1rem;
    /* Increased navbar font */
    transition: color 0.3s ease, background-color 0.3s ease;
}

#menu-top a:hover,
#menu-top a:focus {
    color: var(--primary-blue);
    background-color: transparent;
}

.menu-section {
    background: var(--primary-gradient);
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#menu-top a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    padding: 20px 15px;
    text-transform: uppercase;
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

#menu-top a:hover,
#menu-top a:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-top-active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

.dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

.dropdown-menu>li>a {
    color: var(--primary-text);
    padding: 10px 20px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
    background-color: var(--main-bg);
    color: var(--primary-blue);
}

/* =============================================================
   BUTTONS - Bootstrap Overrides
 ============================================================ */

.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Cairo', Arial, sans-serif;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--card-bg);
    border: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #0e4f75 0%, #1f6390 100%);
    color: var(--card-bg);
    box-shadow: 0 4px 10px rgba(18, 102, 152, 0.4);
}

.btn-info {
    background-color: var(--secondary-blue);
    color: var(--card-bg);
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: #1e6091;
    color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(41, 128, 185, 0.3);
}

.btn-success {
    background-color: var(--primary-blue);
    color: var(--card-bg);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: #0e4f75;
    color: var(--card-bg);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--card-bg);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background-color: #c82333;
    color: var(--card-bg);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--primary-text);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background-color: #e0a800;
    color: var(--primary-text);
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* =============================================================
   ALERTS & BADGES - Bootstrap Overrides
 ============================================================ */

.alert {
    border-radius: 6px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-family: 'Cairo', Arial, sans-serif;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-right: 4px solid var(--success-color);
    border-left: none;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-right: 4px solid var(--info-color);
    border-left: none;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-right: 4px solid var(--warning-color);
    border-left: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-right: 4px solid var(--danger-color);
    border-left: none;
}

.badge,
.label-success {
    background-color: var(--primary-blue) !important;
}

.label-info {
    background-color: var(--secondary-blue) !important;
}

.text-success {
    color: var(--primary-blue) !important;
}

/* =============================================================
   FORMS & INPUTS
 ============================================================ */

.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    font-family: 'Cairo', Arial, sans-serif;
    color: var(--primary-text);
    background-color: var(--card-bg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(18, 102, 152, 0.1);
    outline: none;
}

.form-group label {
    color: var(--primary-text);
    font-weight: 500;
    margin-bottom: 8px;
}

.panel {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: var(--card-bg);
    margin-bottom: 20px;
}

.panel-default>.panel-heading {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    color: var(--primary-blue);
    border-left: 4px solid var(--primary-blue);
}

.panel-body {
    padding: 20px;
}

.panel-info {
    border-color: var(--secondary-blue);
}

.panel-info>.panel-heading {
    background-color: var(--secondary-blue);
    color: var(--card-bg);
    border-color: var(--secondary-blue);
}

/* =============================================================
   TABLES
 ============================================================ */

.table {
    background-color: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
}

.table>thead>tr>th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 15px;
    text-transform: uppercase;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

.table>tbody>tr>td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--primary-text);
    vertical-align: middle;
}

.table>tbody>tr:hover {
    background-color: var(--main-bg);
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: var(--main-bg);
}

.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered>thead>tr>th,
.table-bordered>tbody>tr>td {
    border: 1px solid var(--border-color);
}

/* =============================================================
   DASHBOARD WIDGETS
 ============================================================ */

.back-widget-set {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.back-widget-set:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-widget-set i {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.back-widget-set h3 {
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.back-widget-set.alert-success {
    background-color: var(--card-bg);
    border-right: 4px solid var(--success-color);
    border-left: none;
}

.back-widget-set.alert-info {
    background-color: var(--card-bg);
    border-right: 4px solid var(--info-color);
    border-left: none;
}

.back-widget-set.alert-warning {
    background-color: var(--card-bg);
    border-right: 4px solid var(--warning-color);
    border-left: none;
}

.back-widget-set.alert-danger {
    background-color: var(--card-bg);
    border-right: 4px solid var(--danger-color);
    border-left: none;
}

/* =============================================================
   CAROUSEL & IMAGES
 ============================================================ */

.slide-bdr {
    border: 3px solid var(--primary-blue);
    border-radius: 6px;
    overflow: hidden;
}

.img-comments {
    border: 2px solid var(--border-color);
    border-radius: 6px;
    height: 60px;
}

/* =============================================================
   FOOTER SECTION STYLES
 ============================================================ */

.footer-section {
    padding: 30px 50px;
    color: var(--secondary-text);
    font-size: 0.9rem;
    background-color: var(--card-bg);
    text-align: center;
    border-top: 3px solid var(--primary-blue);
    margin-top: 50px;
}

.footer-section a,
.footer-section a:hover {
    color: var(--primary-blue);
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
}

/* =============================================================
   MISC STYLES
 ============================================================ */

.help-block {
    color: var(--muted-text);
    font-size: 0.875rem;
    margin-top: 5px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--muted-text) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        margin-top: 20px;
        padding-bottom: 50px;
    }

    .header-line {
        font-size: 1.25rem;
    }

    #menu-top a {
        padding: 15px 10px;
        font-size: 0.85rem;
    }

    .back-widget-set {
        margin-bottom: 15px;
    }
}

/* =============================================================
   BOOK GALLERY STYLES
 ============================================================ */

.book-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    height: 100%;
}

.book-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.book-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f0f0f0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-meta {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-available {
    background-color: #d4edda;
    color: #155724;
}

.status-borrowed {
    background-color: #f8d7da;
    color: #721c24;
}

.search-box {
    margin-bottom: 30px;
    position: relative;
}

.search-input {
    height: 50px;
    border-radius: 25px;
    padding-right: 20px;
    padding-left: 0;
    border: 2px solid var(--primary-blue);
}

.search-btn {
    position: absolute;
    left: 5px;
    right: auto;
    top: 5px;
    height: 40px;
    border-radius: 20px;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 20px;
}

/* =============================================================
   WIDGET & DASHBOARD IMPROVEMENTS
 ============================================================ */

.back-widget-set {
    min-height: 180px;
    padding: 25px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.back-widget-set:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.back-widget-set i {
    margin-bottom: 15px;
    display: block;
}

.back-widget-set h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

/* Quick Actions Panel */
.quick-actions {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quick-actions h4 {
    margin-bottom: 15px;
    color: var(--primary-blue);
}

.quick-actions .btn {
    margin: 5px;
    min-width: 140px;
}

/* TABLE IMPROVEMENTS */
.table thead th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    border: none;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* MOBILE RESPONSIVE (< 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .back-widget-set {
        min-height: 150px;
        padding: 20px 15px;
    }

    .back-widget-set i {
        font-size: 3rem !important;
    }

    .back-widget-set h3 {
        font-size: 2rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .quick-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Mobile Navigation Fixes */
@media (max-width: 768px) {
    .navbar-brand img {
        width: 150px !important;
        height: auto !important;
    }

    .right-div {
        float: none !important;
        padding: 10px 15px;
        text-align: center;
        clear: both;
    }

    .right-div .btn {
        width: 100%;
        margin-top: 10px;
    }

    .navbar-header {
        float: none;
    }

    .navbar-toggle {
        display: block;
        margin-left: 15px;
    }

    .navbar-collapse.collapse {
        display: none !important;
        margin-top: 10px;
    }

    .navbar-collapse.collapse.in {
        display: block !important;
    }

    .menu-section {
        display: block !important;
    }
}


.dropdown-menu {
    z-index: 1000;
    display: block;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown.open .dropdown-menu {
    visibility: visible;
    opacity: 1;
}

select.form-control {
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    background-color: white;
    z-index: 1;
}

/* Logout Button Simplified */
.right-div .btn-danger {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: normal;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .right-div .btn-danger {
        padding: 10px 20px;
        width: auto;
        display: inline-block;
        margin: 10px auto;
    }
}

/* Dropdown Menu Complete Fix */
.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9999 !important;
    display: none;
    float: right;
    min-width: 200px;
    padding: 8px 0;
    margin: 2px 0 0;
    font-size: 14px;
    text-align: right;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}

.dropdown.open>.dropdown-menu {
    display: block !important;
}

.dropdown-menu>li>a {
    display: block;
    padding: 10px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.6;
    color: #333;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus {
    color: #fff;
    background-color: var(--primary-blue);
}

/* Ensure parent has position relative */
.dropdown {
    position: relative;
}

/* Fix for navbar dropdowns */
#menu-top .dropdown {
    position: relative;
}

#menu-top .dropdown-menu {
    right: 0;
    left: auto;
}

/* Increase Font Sizes Globally */
body {
    font-size: 18px !important;
}

h1 {
    font-size: 2.8rem !important;
}

h2 {
    font-size: 2.3rem !important;
}

h3 {
    font-size: 2rem !important;
}

h4 {
    font-size: 1.7rem !important;
}

h5 {
    font-size: 1.4rem !important;
}

.table {
    font-size: 16px !important;
}

.table thead th {
    font-size: 17px !important;
}

.btn {
    font-size: 16px !important;
    padding: 12px 24px !important;
}

.form-control {
    font-size: 16px !important;
}

#menu-top a {
    font-size: 1.15rem !important;
}

.header-line {
    font-size: 1.8rem !important;
}

/* Footer Logout Button */
.footer-section .btn-danger {
    background-color: #dc3545;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 15px;
}

.footer-section .btn-danger:hover {
    background-color: #c82333;
}

@media (max-width: 768px) {
    body {
        font-size: 16px !important;
    }

    h1 {
        font-size: 2.2rem !important;
    }

    h2 {
        font-size: 1.9rem !important;
    }

    h3 {
        font-size: 1.6rem !important;
    }

    .table {
        font-size: 14px !important;
    }
}

/* Book Gallery Enhancements */
.book-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.book-card .book-image {
    position: relative;
    overflow: hidden;
}

.book-card:hover .book-image i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Search Panel Styling */
.panel-default {
    border: 1px solid #e0e0e0;
}

.panel-body {
    background: #fafafa;
}

/* Form Controls Enhancement */
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(18, 102, 152, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Responsive Book Cards */
@media (max-width: 768px) {
    .book-card {
        margin-bottom: 20px;
    }

    .book-card .book-image {
        height: 200px !important;
    }

    .book-card .book-details h5 {
        font-size: 16px !important;
        min-height: auto !important;
    }
}

/* Issued Books Card Styling */
.issued-book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.issued-book-card .book-info p {
    transition: all 0.2s ease;
}

.issued-book-card .book-info p:hover {
    padding-right: 5px;
}

/* Responsive Cards */
@media (max-width: 768px) {
    .issued-book-card {
        margin-bottom: 20px !important;
    }

    .issued-book-card .col-xs-2 {
        width: 100%;
        margin-bottom: 15px;
    }

    .issued-book-card .col-xs-10 {
        width: 100%;
    }
}

/* =============================================================
   CONTACT BOX STYLE
 ============================================================ */
.contact-box {
    background: var(--primary-gradient);
    color: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 50px;
}

.contact-box h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.contact-box p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.contact-box i {
    margin-left: 10px;
}

.contact-box .btn-contact {
    background: white;
    color: var(--primary-blue);
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    border: none;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.contact-box .btn-contact:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: var(--secondary-blue);
}

/* Standard horizontal scroll for mobile tables - AGGRESSIVE FIX */
.table-responsive {
    width: 100% !important;
    margin-bottom: 20px !important;
    overflow-y: hidden !important;
    overflow-x: auto !important;
    -ms-overflow-style: -ms-autohiding-scrollbar !important;
    border: 1px solid var(--border-color) !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
}

@media screen and (max-width: 992px) {
    .table-responsive>.table {
        margin-bottom: 0 !important;
        width: 1200px !important;
        /* Force extreme width */
        max-width: none !important;
        table-layout: auto !important;
    }

    .table-responsive>.table>thead>tr>th,
    .table-responsive>.table>tbody>tr>td {
        white-space: nowrap !important;
        padding: 15px 20px !important;
        min-width: 120px !important;
        word-wrap: normal !important;
    }
}

/* =============================================================
   RESPONSIVE RTL NAVBAR FIX
 ============================================================ */

@media (min-width: 768px) {
    .navbar-nav.navbar-right {
        float: right !important;
        display: flex !important;
        flex-direction: row;
        /* Natural RTL row order */
        padding-right: 0;
    }

    .navbar-nav>li {
        float: right !important;
        /* Ensure items align from right to left */
    }

    #menu-top {
        margin-right: 0;
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .navbar-collapse {
        max-height: 100% !important;
        /* Prevent scrolling if menu is long */
    }

    .navbar-nav {
        margin: 0 !important;
        float: none !important;
        display: block !important;
        width: 100%;
    }

    .navbar-nav>li {
        float: none !important;
        display: block !important;
        width: 100%;
        text-align: right;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-nav>li>a {
        padding: 15px 25px !important;
        display: block;
        width: 100%;
    }

    /* Logo adjustment for mobile */
    .navbar-brand {
        padding: 10px 15px !important;
        height: auto !important;
    }

    .logo-img {
        height: 45px !important;
        width: auto !important;
        max-width: 160px !important;
        object-fit: contain;
    }

    .navbar {
        min-height: 70px;
    }
}

/* =============================================================
   PREMIUM MODERN FOOTER STYLES
 ============================================================ */
.main-footer {
    background: #0f2c42; /* Deep Navy Blue */
    color: rgba(255, 255, 255, 0.8);
    padding: 70px 0 0 0;
    margin-top: 60px;
    font-family: 'Cairo', Arial, sans-serif;
    border-top: 4px solid var(--primary-text); /* Orange border for brand consistency */
    direction: rtl;
    text-align: right;
}

.footer-top {
    padding-bottom: 50px;
}

.footer-logo-title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.footer-logo-title i {
    margin-left: 10px;
    color: var(--primary-text); /* Orange accent color */
}

.footer-about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
}

.footer-social-links {
    display: flex;
    gap: 12px;
}

.footer-social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.footer-social-btn:hover {
    background: var(--primary-text);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-col-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}

.footer-col-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-text);
    border-radius: 2px;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links-list a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
}

.footer-links-list a i {
    margin-left: 8px;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-right: 5px;
}

.footer-links-list a:hover i {
    color: var(--primary-text);
    transform: translateX(-3px);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 18px;
}

.footer-contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-left: 15px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.footer-contact-item:hover .footer-contact-icon {
    background: var(--primary-text);
    color: #ffffff;
}

.footer-contact-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-contact-content strong {
    display: block;
    color: #ffffff;
    margin-bottom: 2px;
}

.footer-contact-content a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none !important;
}

.footer-contact-content a:hover {
    color: #ffffff;
}

.footer-bottom {
    background: #081d2c; /* Slightly darker shade */
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copy {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.footer-bottom-links a:hover {
    color: #ffffff;
}

.footer-logout-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(220, 53, 69, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.footer-logout-btn:hover {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.footer-logout-btn i {
    margin-left: 6px;
}

@media (max-width: 768px) {
    .main-footer {
        padding: 50px 0 0 0;
    }
    .footer-top {
        padding-bottom: 30px;
    }
    .footer-col {
        margin-bottom: 35px;
    }
    .footer-col-title {
        margin-bottom: 18px;
    }
    .footer-bottom-flex {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    .footer-bottom-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Final UI readability overrides */
body {
    color: #263241 !important;
}
h1,
h2,
h3,
h4,
h5,
h6,
.header-line {
    color: #17324d !important;
    letter-spacing: 0 !important;
}
.header-line {
    display: block;
    border-bottom: 1px solid #dbe3ec;
    padding-bottom: 14px;
    margin-bottom: 22px;
}
p,
td,
th,
label,
.panel-body,
.book-meta-item {
    color: #334155;
}
.text-muted {
    color: #697586 !important;
}
.panel,
.book-card-horizontal,
.suggestion-card {
    border: 1px solid #e5ebf2;
    border-radius: 8px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
}
.panel-heading {
    background: #f8fafc !important;
    color: #17324d !important;
    border-color: #e5ebf2 !important;
}
.btn-primary,
.btn-info {
    background: #126698 !important;
    border-color: #126698 !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
    background: #0f557e !important;
    border-color: #0f557e !important;
    color: #fff !important;
}
.btn-default {
    background: #fff !important;
    border-color: #cfd8e3 !important;
    color: #334155 !important;
}
.btn-default:hover {
    background: #f8fafc !important;
    border-color: #b8c4d2 !important;
}
.alert-warning {
    background: #fff8e6 !important;
    border-color: #f4d27b !important;
    color: #694b00 !important;
}
.alert-info {
    background: #eef8ff !important;
    border-color: #a8d8f5 !important;
    color: #164b68 !important;
}
.book-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1) !important;
}
.book-title {
    color: #17324d !important;
}
.form-control,
.form-control1,
.select2-container--default .select2-selection--single {
    border-color: #cfd8e3 !important;
}

/* Preserve intentionally light text on dark/visual sections */
.hero-section,
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section p,
.hero-section span,
.hero-section .tagline,
.hero-section .subtitle,
.hero-content,
.hero-content h1,
.hero-content p,
.main-footer,
.main-footer h4,
.main-footer p,
.main-footer span,
.main-footer strong,
.main-footer a,
.footer-section,
.footer-section h6 {
    color: inherit !important;
}
.hero-section,
.hero-content {
    color: #fff !important;
}
.hero-content h1,
.hero-content .tagline,
.hero-content .subtitle {
    color: #fff !important;
}
.main-footer {
    color: rgba(255, 255, 255, 0.78) !important;
}
.footer-logo-title,
.footer-col-title,
.footer-contact-content strong {
    color: #fff !important;
}
