/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header styles */
header {
    background-color: #007bff;
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a[href*="my_services"] {
    background-color: #28a745;
}

nav a[href*="my_services"]:hover {
    background-color: #218838;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile menu overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: flex-end;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-content {
    background-color: white;
    width: 250px;
    height: 100%;
    padding: 0;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    background-color: #007bff;
    color: white;
}

.mobile-menu-header span {
    font-weight: bold;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-links {
    flex: 1;
    padding: 1rem 0;
}

.mobile-menu-links a {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.mobile-menu-links a:hover {
    background-color: #f8f9fa;
}

/* Main content */
main {
    margin-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 80px); /* Account for header only, footer is now relative */
    display: flex;
    flex-direction: column;
}

/* Hero section */
.hero {
    background-color: #f8f9fa;
    padding: 4rem 20px;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #007bff;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.hero-text a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.hero-text a:hover {
    text-decoration: underline;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Services section */
.services {
    padding: 4rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.services h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s;
}

.service-item:hover {
    transform: translateY(-5px);
}

.service-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    max-width: 100%;
    max-height: 200px;
}

.service-item h3 {
    padding: 1rem;
    font-size: 1.5rem;
}

.service-item p {
    padding: 0 1rem 1rem;
    color: #666;
}

/* Form section */
.form-section {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Checkbox styling */
.checkbox-group, .checkbox-grid {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    padding: 0.25rem 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Form row for side-by-side fields */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half {
    flex: 1;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.back-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #5a6268;
}

/* Login links styling */
.login-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.login-links a {
    color: #007bff;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.separator {
    color: #666;
}

/* Admin actions styling */
.admin-actions {
    margin-top: 1rem;
}

.admin-nav-button {
    background-color: #28a745 !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    margin-left: 1rem !important;
}

.admin-nav-button:hover {
    background-color: #218838 !important;
}

/* User info styling */
.user-info {
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

/* User welcome section styling */
.user-welcome-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Schedule button styling */
.schedule-btn {
    background-color: #28a745 !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    margin-right: 15px !important;
}

.schedule-btn:hover {
    background-color: #218838 !important;
}

/* Appointments table styling */
.appointments-section {
    width: 100%;
    margin: 2rem auto;
    padding: 0 20px;
}

.appointments-table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.appointments-table th,
.appointments-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.appointments-table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.appointments-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.appointments-table tr:hover {
    background-color: #e9ecef;
}

.appointment-count {
    text-align: center;
    font-weight: bold;
    color: #007bff;
    margin: 1rem 0;
}

.no-appointments {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 2rem 0;
}

/* Status badge styling */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-confirmed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rescheduled {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Confirm button styling */
.confirm-btn {
 
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.confirm-btn:hover {
    background-color: #0056b3;
}

/* Complete button styling */
.complete-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.complete-btn:hover {
    background-color: #218838;
}

.confirmed-text {
    color: #28a745;
    font-weight: bold;
    font-style: italic;
}

/* Reschedule button styling */
.reschedule-btn {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.reschedule-btn:hover {
    background-color: #e0a800;
}

/* History button styling */
.history-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.history-btn:hover {
    background-color: #138496;
}

/* History table styling */
.history-table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.history-table th,
.history-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.history-table th {
    background-color: #17a2b8;
    color: white;
    font-weight: bold;
}

.history-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.history-table tr:hover {
    background-color: #e9ecef;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 2rem 0;
}

/* Service button styling */
.service-btn {
    background-color: #6f42c1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.service-btn:hover {
    background-color: #5a32a3;
}

/* Services table styling */
.services-table-container {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.services-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.services-table th,
.services-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.services-table th {
    background-color: #6f42c1;
    color: white;
    font-weight: bold;
}

.services-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.services-table tr:hover {
    background-color: #e9ecef;
}

/* Payment button styling */
.payment-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.payment-btn:hover {
    background-color: #218838;
}

/* Status badges for services */
.status-paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-partial {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-unpaid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.paid-text {
    color: #28a745;
    font-weight: bold;
    font-style: italic;
}

/* Services summary styling */
.services-summary {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    width: 300px;
}

.services-summary h4 {
    margin-top: 0;
    color: #495057;
}

.services-summary p {
    margin: 0.5rem 0;
    font-weight: bold;
}

/* Service history section styling */
.service-history-section {
    margin: 2rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.service-history-section h4 {
    margin-top: 0;
    color: #6f42c1;
    border-bottom: 2px solid #6f42c1;
    padding-bottom: 0.5rem;
}

/* Report button styling */
.report-btn {
    background-color: #fd7e14;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
}

.report-btn:hover {
    background-color: #e8680f;
}

/* Clear button styling */
.clear-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #5a6268;
}

/* Service details textarea styling */
#service_details {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
}

/* Settle button styling */
.settle-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.settle-btn:hover {
    background-color: #218838;
}

/* Settle all button styling */
.settle-all-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.settle-all-btn:hover {
    background-color: #c82333;
}

/* Delete button styling */
.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Cancel button styling */
.cancel-btn {
    background-color: #e00e38;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
    transition: background-color 0.3s;
    width: 185px;
}

.cancel-btn:hover {
    background-color: #c015d6;
}

/* Alert messages */
.alert {
    padding: 0.75rem 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;
}

/* Footer */
footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 1rem 0;
    position: relative;
    width: 100%;
    margin-top: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Show mobile menu button and hide desktop nav on mobile */
    .mobile-menu-btn {
        display: block;
    }

    .desktop-nav {
        display: none;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-image {
        order: -1; /* Ensure image appears first on mobile */
        margin-bottom: 1rem;
    }

    .hero-text {
        order: 1;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .form-section {
        margin: 2rem 20px;
        max-width: none;
        width: auto;
    }

    /* Mobile-specific form adjustments */
    .form-section form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .form-group {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .checkbox-group, .checkbox-grid {
        padding: 1rem;
        gap: 0.75rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .checkbox-label {
        font-size: 1rem;
        padding: 0.5rem 0;
    }
}

/* Filter section styling */
.filter-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #495057;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.filter-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.filter-btn:hover {
    background-color: #0056b3;
}

.clear-filter-btn {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
    display: inline-block;
}

.clear-filter-btn:hover {
    background-color: #5a6268;
}

/* Desktop form layout */
@media (min-width: 769px) {
    .form-section {
        max-width: 600px;
        margin: 4rem auto;
    }
}

/* Action buttons grid styling */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    align-items: start;
}

.action-buttons-grid form,
.action-buttons-grid a,
.action-buttons-grid button {
    margin: 0;
}

/* Mobile filter adjustments */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: auto;
    }

    .filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .filter-btn,
    .clear-filter-btn {
        width: 100%;
        text-align: center;
    }

    /* Mobile action buttons - stack vertically on small screens */
    .action-buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}