/* ################################################################## */
/* #       HOME SERVICES PRO - STYLESHEET (style.css)             # */
/* #        *** SUB-SERVICES & PRICING UPDATE APPLIED ***           # */
/* ################################################################## */

/* --- ROOT & GLOBAL STYLES --- */
:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #14b8a6;
    --accent-dark: #0d9488;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --font-sans: 'Inter', system-serif, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-dark);
}

/* --- MAIN LAYOUT & APP CONTAINER --- */
.main-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.app-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 16px 16px 100px 16px; /* Padding at bottom for navbar */
}

.app-header {
    text-align: center;
    padding: 16px 0 0 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
}

.logo svg {
    color: var(--accent);
    width: 28px;
    height: 28px;
}

.logo-white {
    color: white;
}

/* --- CARDS & FORMS --- */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 700;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px #14b8a620;
}

.btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: 0;
    background: var(--accent);
    color: white;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    font-size: 16px;
    transition: background-color 0.2s;
}

.btn:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
}

.btn-success {
    background: var(--success);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
}

/* --- USER DASHBOARD --- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.service-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 110px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    text-align: center;
    padding: 10px;
    transition: all 0.2s ease-in-out;
}

.service-card:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 28px;
}

/* --- PROVIDER CARDS & LISTS --- */
.provider-card-link {
    display: block;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.provider-card-link:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.provider-card-link h4 {
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
}

.provider-card-link p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.rating-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 8px;
}

.rating-stars {
    color: #f59e0b;
}

.booking-form {
    margin-top: 16px;
}

.provider-services-list {
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.provider-service-item b {
    color: var(--text-primary);
}

.service-booking-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.date-picker-group {
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 16px;
}

/* --- PROVIDER DASHBOARD: MY SERVICES PAGE --- */
.crud-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn-edit-icon, .btn-danger-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    text-decoration: none;
    padding: 5px;
}

.btn-edit-icon {
    color: var(--text-secondary);
}

.btn-danger-icon {
    color: var(--danger);
}

/* --- STATUS BADGES --- */
.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status.pending { background: #f59e0b20; color: #d97706; }
.status.accepted { background: #22c55e20; color: #15803d; }
.status.rejected { background: #ef444420; color: #b91c1c; }
.status.completed { background: #3b82f620; color: #1d4ed8; }

/* --- PROVIDER BOTTOM NAVBAR --- */
#provider-dashboard { padding-bottom: 85px; } /* Ensure content is above navbar */

.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    padding: 8px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 8px;
    transition: color 0.2s;
    flex-grow: 1;
    text-align: center;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* --- ADMIN PANEL --- */
.admin-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
    z-index: 2000;
}

.admin-sidebar .logo {
    color: white;
    justify-content: flex-start;
    margin-bottom: 32px;
    font-size: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: #334155;
    color: white;
}

.admin-sidebar .icon-svg {
    width: 20px;
    height: 20px;
}

.admin-content {
    flex: 1;
    padding: 24px;
    margin-left: 240px;
    transition: margin-left 0.3s ease;
}

.admin-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 28px;
}

.mobile-menu-toggle {
    display: none;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.stat-card .icon-wrapper.accent { background-color: #14b8a620; color: var(--accent-dark); }
.stat-card .icon-wrapper.success { background-color: #22c55e20; color: #15803d; }
.stat-card .icon-wrapper.warning { background-color: #f59e0b20; color: #d97706; }
.stat-card .icon-wrapper.info { background-color: #3b82f620; color: #1d4ed8; }

.stat-card .stat-info h3 {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-card .stat-info p {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* --- RESPONSIVE ADMIN (Mobile Friendly) --- */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-wrapper.sidebar-open .admin-sidebar {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    }

    .admin-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 70px;
    }

    .admin-header h1 {
        font-size: 22px;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        left: 16px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        z-index: 3000;
        width: 40px;
        height: 40px;
        cursor: pointer;
        font-size: 24px;
    }
}

/* --- TABLES --- */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background: #f8fafc;
}

tr:last-child td {
    border-bottom: 0;
}

td b {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- SPINNER FOR AJAX LOADING --- */
.spinner-container {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- LOCATION MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    margin: 16px;
}
#locationMap {
    height: 250px;
    width: 100%;
    margin-bottom: 16px;
    border-radius: 10px;
    z-index: 1; /* Ensure map is below search bar */
}
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* --- LEAFLET GEOSEARCH STYLES --- */
.leaflet-control-geosearch {
    font-family: var(--font-sans);
}
.leaflet-control-geosearch .bar {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}
.leaflet-control-geosearch .bar form input {
    font-size: 14px;
    padding: 10px 14px;
    height: auto;
    border-radius: 10px;
}
.leaflet-control-geosearch .results {
    border-radius: 10px;
    margin-top: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}
.leaflet-control-geosearch .results > * {
    padding: 10px 14px;
    font-size: 14px;
}
.leaflet-control-geosearch .results > .active,
.leaflet-control-geosearch .results > :hover {
    background-color: var(--accent);
    color: white;
}