/* ===============================
   RESET & BASE
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", Arial, sans-serif;
    background: #f1f5f9;
    color: #1f2937;
    min-height: 100vh;
}

/* ===============================
   SIDEBAR (PRO ADMIN)
================================ */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #0b132b, #1c2541);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h1 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: #c7d2fe;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.25s ease;
    position: relative;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(37,99,235,0.18);
    color: #fff;
}

.sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #3b82f6;
}

.sidebar-nav a.logout {
    margin-top: auto;
    color: #fca5a5;
}

/* ===============================
   MAIN CONTENT
================================ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===============================
   HEADER
================================ */
.top-header {
    height: 56px;
    background: linear-gradient(90deg, #1e293b, #334155);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    margin-right: 15px;
    cursor: pointer;
}

/* ===============================
   DASHBOARD WRAPPER
================================ */
.dashboard-wrapper {
    padding: 24px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===============================
   CARDS
================================ */
.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 20px;
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

/* ===============================
   STATS
================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    padding: 24px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h4 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 32px;
    font-weight: 700;
}

/* ===============================
   TABLE
================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background: #f8fafc;
}

table th, table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

table th {
    font-weight: 600;
    color: #334155;
}

table tbody tr:hover {
    background: #f1f5f9;
}

/* ===============================
   FORMS & BUTTONS
================================ */
input, select, textarea {
    width: 52%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

.btn {
    background: #2563eb;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #1d4ed8;
}

.btn.danger {
    background: #dc2626;
}

.btn.danger:hover {
    background: #b91c1c;
}

/* ===============================
   PAGINATION (UI ONLY)
================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination .btn {
    padding: 8px 14px;
}

/* ===============================
   ERROR MESSAGE
================================ */
.error-message {
    font-size: 12px;
    color: red;
    margin-top: 4px;
}

/* ===============================
   MOBILE RESPONSIVE
================================ */
@media (max-width: 768px) {

    .hamburger {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-wrapper {
        padding: 16px;
    }

    table {
        font-size: 13px;
    }
}


/* ===============================
   DOCTORS LIST – SPACING FIX
================================ */

/* Card header spacing */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

/* Search / filter spacing */
.search-form {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    align-items: center;
}

.search-form input,
.search-form select {
    height: 44px;
}

/* On small screens stack filters */
@media (max-width: 992px) {
    .search-form {
        flex-direction: column;
    }
}

/* Desktop search input width adjustment */
@media (min-width: 992px) {
    .input-with-icon input {
        width: 52%;
        min-width: 52%;
    }
}

/* Table spacing */
.table-responsive {
    margin-top: 10px;
}

table th {
    padding-top: 16px;
    padding-bottom: 16px;
}

table td {
    vertical-align: middle;
}

/* Actions buttons spacing */
td .btn {
    margin-right: 8px;
    margin-bottom: 6px;
}

/* Make table rows less cramped */
table tbody tr {
    height: 56px;
}

/* Pagination spacing */
.pagination {
    margin-top: 30px;
}

/* ===============================
   ACTION BUTTON FIX (TABLE)
================================ */

/* Actions column layout */
table td:last-child {
    white-space: nowrap;
}

/* Button group inside Actions */
table td:last-child .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    margin-bottom: 0;
}

/* Remove extra margin on last button */
table td:last-child .btn:last-child {
    margin-right: 0;
}


/* ===== FORM GRID CLEAN UI ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    background: #fff;
}

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

/* Full width fields */
.form-group textarea,
#other-city-wrap {
    grid-column: span 2;
}

/* Buttons */
.form-actions {
    grid-column: span 2;
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* ===== ACTION ICONS ===== */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.action-icon.view {
    color: #2563eb;
    background: #eff6ff;
}

.action-icon.view:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.action-icon.edit {
    color: #059669;
    background: #ecfdf5;
}

.action-icon.edit:hover {
    background: #d1fae5;
    color: #047857;
}

.action-icon.delete {
    color: #dc2626;
    background: #fef2f2;
}

.action-icon.delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.action-icon i {
    pointer-events: none;
}

/* ===== ACTION BUTTONS ===== */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: #fff;
    margin-right: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.view-btn {
    background-color: #facc15; /* yellow */
    color: #1f2937;
}

.view-btn:hover {
    background-color: #eab308;
}

.edit-btn {
    background-color: #22c55e; /* green */
}

.edit-btn:hover {
    background-color: #16a34a;
}

.delete-btn {
    background-color: #ef4444; /* red */
}

.delete-btn:hover {
    background-color: #dc2626;
}

/* ===== READONLY FIELDS ===== */
.readonly-field {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* Mobile */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group textarea,
    #other-city-wrap,
    .form-actions {
        grid-column: span 1;
    }
}


/* =========================
   HAMBURGER VISIBILITY FIX
========================= */

/* Hide hamburger by default (DESKTOP) */
.sidebar-toggle {
    display: none;
}

/* Show hamburger ONLY on mobile/tablet */
@media (max-width: 991px) {
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.sidebar .badge {
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
}


/* ===============================
   PUBLIC PAGE STYLES
   =============================== */

.public-page {
    background: #f5f7fa;
}

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: #f5f7fa;
}

/* Neutralize dashboard layout */
.public-page .dashboard-wrapper {
    margin-left: 0 !important;
}

.public-page .dashboard-container {
    padding: 40px 15px;
}

/* ===============================
   PUBLIC HEADER
   =============================== */

.public-top-header {
    height: 64px;
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    justify-self: end;
}

.header-actions {
    width: auto;
    max-width: fit-content;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.25s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* ===============================
   SEARCH / FILTER CARD
   =============================== */

.search-filter-card {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 20px;
}

.search-filter-card h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Form Layout */
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 20px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
}

.input-with-icon input {
    padding-left: 38px;
    width: 260px;
    min-width: 260px;
}

.search-form select:nth-child(2) {
    width: 180px;
}

.search-form select:nth-child(3) {
    width: 160px;
}

.search-form select:nth-child(4) {
    width: 220px;
}

.search-form select:nth-child(5) {
    width: 180px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-actions .btn {
    height: 44px;
    min-width: 90px;
    padding: 0 16px;
    line-height: 44px !important;
    margin: 0;
}

.search-form input,
.search-form select,
.search-form .btn {
    height: 44px;
    line-height: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.25s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Messages */
.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

/* ===============================
   DOCTOR CARDS
   =============================== */

.doctor-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.doctor-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.doctor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.doctor-card h4 {
    margin: 0 0 8px 0;
    color: #2563eb;
    font-weight: 700;
    font-size: 18px;
}

.doctor-card .speciality {
    font-weight: 700;
    color: #059669;
    margin-bottom: 12px;
    font-size: 14px;
}

.doctor-card p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.doctor-card p strong {
    font-weight: 600;
    color: #374151;
}

/* ===============================
   PAGINATION
   =============================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease;
}

.pagination a {
    background: #fff;
    color: #2563eb;
    border: 1px solid #cbd5e1;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .active {
    background: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
}

/* ===============================
   RESPONSIVE RULES
   =============================== */

/* Tablet */
@media (max-width: 992px) {
    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .doctor-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .public-top-header {
        padding: 0 16px;
    }

    .header-title {
        font-size: 16px;
    }

    .header-logo {
        height: 32px;
    }

    .btn-primary {
        padding: 6px 12px;
        font-size: 13px;
    }

    .dashboard-container {
        padding: 20px 10px;
    }

    .search-filter-card {
        padding: 20px 16px;
        margin-bottom: 30px;
    }

    .search-filter-card h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .search-form {
        flex-direction: column;
        gap: 16px; /* Increased vertical spacing between fields */
    }

    .search-form input,
    .search-form select {
        width: 100% !important; /* Force 100% width for all select fields */
    }

    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .mobile-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .mobile-actions .btn {
        width: 100%;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }

    .doctor-cards {
        grid-template-columns: 1fr;
        gap: 20px; /* Increased spacing between cards */
    }

    .doctor-card {
        padding: 24px; /* Comfortable padding inside cards */
        border-radius: 12px; /* Apply border-radius */
        box-shadow: 0 4px 16px rgba(0,0,0,0.08); /* Subtle box-shadow */
    }

    .doctor-card h4 {
        font-size: 18px; /* Improve readability */
        margin-bottom: 12px;
    }

    .doctor-card .speciality {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .doctor-card p {
        font-size: 14px;
        line-height: 1.5; /* Better visual hierarchy */
        margin: 8px 0;
    }

    .pagination {
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* ===============================
   PUBLIC ADD DOCTOR PAGE STYLES
   =============================== */

/* Card */
.public-page .card {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 30px 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Grid form */
.public-page .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
}

.public-page .form-group {
    display: flex;
    flex-direction: column;
}

.public-page .form-group label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.public-page .form-group input,
.public-page .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
}

/* Full width fields */
.public-page textarea,
.public-page .form-actions {
    grid-column: 1 / -1;
}

/* Button */
.public-page .btn {
    width: 100%;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.public-page .btn:hover {
    background: #1e40af;
}

/* Messages */
.public-page .success {
    background: #dcfce7;
    color: #166534;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.public-page .error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Mobile */
@media (max-width: 640px) {
    .public-page .form-grid {
        grid-template-columns: 1fr;
    }
}


