/* Consultation Services - Frontend Styles */

:root {
    --cs-button-color: #007bff;
    --cs-card-radius: 8px;
}

/* Container */
.cs-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.cs-container *, .cs-container *::before, .cs-container *::after {
    box-sizing: border-box;
}

/* Search Bar */
.cs-search-wrap {
    position: relative;
    margin-bottom: 16px;
    max-width: 400px;
}

.cs-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.cs-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-search-input:focus {
    border-color: var(--cs-button-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cs-button-color) 15%, transparent);
}

.cs-search-input::placeholder {
    color: #94a3b8;
}

.cs-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    display: none;
    transition: color 0.2s ease;
}

.cs-search-clear:hover {
    color: #475569;
}

.cs-search-wrap.has-value .cs-search-clear {
    display: block;
}

/* Category Filter Bar */
.cs-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
}

.cs-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.cs-filter-pill:hover {
    border-color: var(--pill-color, var(--cs-button-color));
    color: var(--pill-color, var(--cs-button-color));
    background: color-mix(in srgb, var(--pill-color, var(--cs-button-color)) 8%, transparent);
}

.cs-filter-pill.active {
    background: var(--pill-color, var(--cs-button-color));
    border-color: var(--pill-color, var(--cs-button-color));
    color: #fff;
}

/* Grid Layout */
.cs-grid {
    display: grid;
    gap: 24px;
}

.cs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cs-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* List Layout */
.cs-layout-list {
    grid-template-columns: 1fr !important;
}

.cs-layout-list .cs-card {
    flex-direction: row;
}

.cs-layout-list .cs-card-image {
    width: 200px;
    min-height: 160px;
    flex-shrink: 0;
    border-radius: var(--cs-card-radius) 0 0 var(--cs-card-radius);
}

/* Card */
.cs-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--cs-card-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cs-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.cs-card.cs-hidden {
    display: none;
}

/* Card Image */
.cs-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.cs-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-service-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Card Body */
.cs-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Badge Row */
.cs-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

/* Category Badge */
.cs-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

/* NHS Badge */
.cs-nhs-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    background: #005eb8;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Card Title */
.cs-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* Service Code */
.cs-service-code {
    display: block;
    font-size: 10px !important;
    font-weight: 100 !important;
    color: #e2e8f0 !important;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    opacity: 0.35 !important;
}

/* Card Description */
.cs-card-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 14px;
    flex: 1;
}

/* Card Meta */
.cs-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748b;
}

.cs-price {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
}

.cs-price.cs-price-free {
    color: #1e293b !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 11px !important;
    font-weight: 200 !important;
    letter-spacing: 0.5px;
    opacity: 0.7;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.cs-icon-phone {
    flex-shrink: 0;
    opacity: 0.6;
}

.cs-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cs-icon {
    vertical-align: middle;
}

.cs-delivery {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
}

/* Book Button */
.cs-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--cs-button-color);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    text-align: center;
    margin-top: auto;
}

.cs-book-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff !important;
    text-decoration: none !important;
}

.cs-book-btn:active {
    transform: translateY(0);
}

/* No services */
.cs-no-services {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

/* Responsive */
@media (max-width: 1024px) {
    .cs-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .cs-cols-3,
    .cs-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-layout-list .cs-card {
        flex-direction: column;
    }

    .cs-layout-list .cs-card-image {
        width: 100%;
        border-radius: var(--cs-card-radius) var(--cs-card-radius) 0 0;
    }

    .cs-category-filter {
        gap: 6px;
    }

    .cs-filter-pill {
        padding: 6px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cs-search-wrap {
        max-width: 100%;
    }

    .cs-cols-2,
    .cs-cols-3,
    .cs-cols-4 {
        grid-template-columns: 1fr;
    }

    .cs-card-image {
        height: 160px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Container */
    .cs-container {
        color: #e2e8f0;
    }

    /* Cards */
    .cs-card {
        background: #1e293b;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .cs-card:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }

    /* Card Image placeholder */
    .cs-card-image-placeholder {
        opacity: 0.8;
    }

    /* Card Title */
    .cs-card-title {
        color: #f1f5f9;
    }

    .cs-card-title a {
        color: #f1f5f9 !important;
    }

    /* Service Code */
    .cs-service-code {
        color: #64748b !important;
        opacity: 0.5 !important;
    }

    /* Description */
    .cs-card-description {
        color: #94a3b8;
    }

    /* Meta row */
    .cs-card-meta {
        color: #94a3b8;
    }

    /* Price */
    .cs-price {
        color: #f1f5f9;
    }

    /* Free text */
    .cs-price.cs-price-free {
        color: #94a3b8 !important;
    }

    /* Duration */
    .cs-duration {
        color: #94a3b8;
    }

    /* Delivery badge */
    .cs-delivery {
        background: #334155;
        color: #94a3b8;
    }

    /* Category badge on cards */
    .cs-category-badge {
        opacity: 0.9;
    }

    /* NHS badge */
    .cs-nhs-badge {
        background: #003087;
        opacity: 0.9;
    }

    /* Search bar */
    .cs-search-input {
        background: #1e293b;
        border-color: #334155;
        color: #e2e8f0;
    }

    .cs-search-input::placeholder {
        color: #64748b;
    }

    .cs-search-input:focus {
        border-color: var(--cs-button-color);
    }

    .cs-search-clear {
        color: #64748b;
    }

    .cs-search-clear:hover {
        color: #e2e8f0;
    }

    /* Filter pills */
    .cs-filter-pill {
        background: #1e293b;
        border-color: #334155;
        color: #94a3b8;
    }

    .cs-filter-pill:hover {
        background: #334155;
        border-color: var(--pill-color, var(--cs-button-color));
        color: #e2e8f0;
    }

    .cs-filter-pill.active {
        color: #fff;
    }

    /* Book button */
    .cs-book-btn {
        opacity: 0.95;
    }

    .cs-book-btn:hover {
        opacity: 1;
    }

    /* No services */
    .cs-no-services {
        color: #94a3b8;
    }
}

/* Animation for filter transitions */
.cs-card {
    animation: cs-fadeIn 0.3s ease;
}

@keyframes cs-fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
