/* ==========================================================================
   Hadezta Registration – Responsive CSS
   Mobile-first approach with breakpoints for tablet and desktop
   ========================================================================== */

/* ---------- Base ---------- */
body, html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    text-rendering: optimizeLegibility;
    background-color: #f5f5ed;
    font-size: 14px;
}

a {
    color: #333;
    text-decoration: none;
}
a:hover {
    color: #0d6efd;
}

/* ---------- Main Content ---------- */
.main-content {
    padding-bottom: 90px; /* space for fixed bottom toolbar */
    padding-top: 8px;
}

/* ---------- Buttons ---------- */
.back_button {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.back_button_doctor {
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

/* ---------- Submit / Save Bar ---------- */
.submit_button {
    background-color: rgb(95 133 226 / 50%);
    position: fixed;
    bottom: 70px;
    width: 100%;
    left: 0;
    z-index: 1020;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.create_button {
    justify-content: center;
    padding: 10px 16px;
    margin-right: auto;
    margin-left: auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    height: 55px;
}

/* ---------- Tables ---------- */
tr {
    font-size: 12px;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.dataTables_paginate,
.dataTables_info,
.dataTables_length,
.dataTables_filter {
    font-size: 12px;
}

.dataTables_wrapper {
    overflow-x: auto;
}

.dataTable {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* ---------- Bottom Toolbar (Footer Nav) ---------- */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: block;
    background: #f8f9fa;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1030;
    padding: 4px 0;
}

.bottom-toolbar ul {
    margin: 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bottom-toolbar ul li {
    margin: 0;
    flex: 1;
    text-align: center;
}

.nav-link-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    color: #666;
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s ease;
}

.nav-link-footer:hover,
.nav-link-footer.active {
    color: #0d6efd;
}

.nav-link-footer.active {
    font-weight: 600;
}

.footer-icon .las {
    font-size: 28px;
    line-height: 1;
}

.footer-label {
    margin-top: 2px;
    font-size: 11px;
}

/* ---------- Cards ---------- */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 0;
    border-radius: 8px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.form_type {
    margin-bottom: 0;
    padding: 0;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    border: 0;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.form_type:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

/* ---------- Index & Settings Icons ---------- */
.index-icon,
.settings-icon {
    font-size: 48px;
    color: #0d6efd;
}

/* ---------- Search ---------- */
input[type="search"] {
    width: 100%;
    max-width: 230px;
    height: 30px;
    margin-bottom: 10px;
}

/* ---------- Active State ---------- */
.nav-link-footer.active {
    background-color: transparent;
    color: #0d6efd;
}

/* ---------- Login ---------- */
.login-box {
    width: 100%;
    max-width: 380px;
    padding: 24px;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    color: #555;
    text-decoration: none;
    font-weight: normal;
    margin-top: 0;
}

img.login_logo {
    margin-top: 0;
    margin-bottom: 10px;
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* ---------- Bottom Margin (for pages with fixed bottom bar) ---------- */
.bottom_margin {
    margin-bottom: 100px !important;
}

/* ---------- Charts ---------- */
.chart-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Badges ---------- */
.badge {
    font-size: 11px;
    font-weight: 500;
}

/* ---------- Select2 Responsive Fix ---------- */
.select2-container {
    width: 100% !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* ---- Mobile: up to 575px ---- */
@media (max-width: 575.98px) {
    body {
        font-size: 13px;
    }

    .main-content {
        padding-top: 4px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1.05rem; }
    h5 { font-size: 1rem; }

    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Footer icons smaller on small screens */
    .footer-icon .las {
        font-size: 24px;
    }
    .footer-label {
        font-size: 10px;
    }

    /* DataTables controls stack */
    .dataTables_length,
    .dataTables_filter {
        text-align: left !important;
        margin-bottom: 8px;
    }
    .dataTables_filter input {
        width: 100% !important;
    }

    /* Submit bar adapts */
    .create_button {
        padding: 8px 12px;
        height: auto;
    }

    /* Login box full-width on small phones */
    .login-box {
        margin-left: 12px;
        margin-right: 12px;
        padding: 16px;
    }

    /* Card headers slightly smaller */
    .card-header h6 {
        font-size: 0.9rem;
    }

    /* Table text even smaller on mobile */
    tr {
        font-size: 11px;
    }
}

/* ---- Tablet: 576px – 991px ---- */
@media (min-width: 576px) and (max-width: 991.98px) {
    .footer-icon .las {
        font-size: 30px;
    }
    .footer-label {
        font-size: 11px;
    }

    .create_button {
        max-width: 600px;
        height: 55px;
    }

    .bottom-toolbar ul li {
        flex: 0 0 auto;
        margin: 0 16px;
    }
}

/* ---- Desktop: 992px+ ---- */
@media (min-width: 992px) {
    .main-content {
        padding-bottom: 80px;
    }

    .footer-icon .las {
        font-size: 32px;
    }
    .footer-label {
        font-size: 12px;
    }

    .create_button {
        max-width: 970px;
        height: 65px;
    }

    .bottom-toolbar ul li {
        flex: 0 0 auto;
        margin: 0 24px;
    }

    /* Index/Settings icons larger on desktop */
    .index-icon,
    .settings-icon {
        font-size: 56px;
    }
}

/* ---- Large Desktop: 1200px+ ---- */
@media (min-width: 1200px) {
    .create_button {
        max-width: 1140px;
    }
}

/* ---------- Touch device improvements ---------- */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets on touch devices */
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }

    /* Remove hover effects that look stuck on touch */
    .card:hover {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
        transform: none;
    }
    .form_type:hover {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
        transform: none;
    }
}

/* ---------- Print ---------- */
@media print {
    .bottom-toolbar,
    .submit_button,
    .navbar {
        display: none !important;
    }
    .main-content {
        padding-bottom: 0;
    }
    .bottom_margin {
        margin-bottom: 0 !important;
    }
}
