/**
 * ============================================================================
 * SERVICES PAGE - Page Specific Styles
 * ============================================================================
 * Styles specific to the services filter and listing page
 * Used only on /v1/home/services.php
 * ============================================================================
 */

/* ============================================================================
 * MAIN LAYOUT
 * ============================================================================ */

.services-main {
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--light-bg-1) 0%, var(--light-bg-2) 100%);
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* ============================================================================
 * FILTER SECTION (LEFT)
 * ============================================================================ */

.services-filter {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-header {
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-text);
    margin: 0;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--dark-text);
    background-color: var(--white);
    transition: all 0.3s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.filter-input::placeholder {
    color: var(--light-text);
}

/* ============================================================================
 * FILTER BUTTONS
 * ============================================================================ */

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

.btn-block:first-of-type {
    margin-top: 0;
}

#applyFilters {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
}

#applyFilters:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

#clearFilters {
    background: var(--light-bg-1);
    color: var(--dark-text);
    border: 1px solid var(--border-color);
}

#clearFilters:hover {
    background: var(--light-bg-2);
    border-color: var(--primary-color);
}

/* ============================================================================
 * SERVICES LIST SECTION (RIGHT)
 * ============================================================================ */

.services-list-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.services-list-header {
    margin-bottom: 30px;
    text-align: center;
}

.services-list-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-text);
    margin: 0 0 10px 0;
}

.services-description {
    font-size: 16px;
    color: var(--light-text);
    margin: 0;
}

/* ============================================================================
 * LOADING & ERROR STATES
 * ============================================================================ */

.loading-indicator {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-bg-1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert-danger {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* ============================================================================
 * SERVICES GRID
 * ============================================================================ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    padding: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.service-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.service-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-category {
    display: inline-block;
    background: var(--light-bg-1);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.service-description {
    font-size: 14px;
    color: var(--light-text);
    margin: 10px 0;
    flex-grow: 1;
    line-height: 1.6;
}

.service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.service-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.service-price-label {
    display: block;
    font-size: 11px;
    color: var(--light-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-action {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.service-action:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ============================================================================
 * NO SERVICES MESSAGE
 * ============================================================================ */

.no-services-message {
    text-align: center;
    padding: 60px 20px;
}

.no-services-message i {
    font-size: 64px;
    color: var(--light-bg-1);
    margin-bottom: 20px;
}

.no-services-message h3 {
    font-size: 24px;
    color: var(--dark-text);
    margin-bottom: 10px;
}

.no-services-message p {
    color: var(--light-text);
    font-size: 16px;
}

/* ============================================================================
 * PAGINATION
 * ============================================================================ */

.pagination-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.pagination {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.page-link:hover:not(.active) {
    background: var(--light-bg-1);
    border-color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ============================================================================
 * MODAL - SERVICE DETAILS
 * ============================================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-lg {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--light-text);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--dark-text);
}

.modal-body {
    padding: 30px;
}

/* ============================================================================
 * RESPONSIVE DESIGN
 * ============================================================================ */

@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .services-filter {
        position: static;
        top: auto;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .services-main {
        padding: 30px 15px;
    }

    .services-list-section {
        padding: 20px;
    }

    .services-list-header h2 {
        font-size: 24px;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .service-card-header {
        padding: 15px;
        min-height: 70px;
    }

    .service-card-header h3 {
        font-size: 16px;
    }

    .service-card-body {
        padding: 15px;
    }

    .filter-input,
    .filter-select {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .services-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .services-filter {
        display: none;
    }

    .services-main {
        padding: 20px 10px;
    }

    .services-list-section {
        padding: 15px;
    }

    .services-list-header h2 {
        font-size: 20px;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .service-card-header h3 {
        font-size: 14px;
    }

    .service-description {
        font-size: 12px;
    }

    .service-price {
        font-size: 16px;
    }

    .pagination-container {
        margin-top: 20px;
        padding-top: 20px;
    }

    .page-link {
        min-width: 35px;
        height: 35px;
        font-size: 12px;
    }
}
