/* Main Content Styles */
main {
    padding: 3rem 0;
    background: var(--gradient-primary);
    min-height: calc(100vh - 120px);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    color: var(--dark-blue);
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

p {
    color: var(--dark);
    font-size: 1.4rem;
    margin: 1.5rem 0;
    line-height: 1.6;
    max-width: 800px;
}

.left-side p {
    margin: 0;
}

/* Filter Cards */
.filter-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-card {
    padding: 10px 24px;
    border-radius: 50px;
    background-color: white;
    color: var(--dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.6rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.filter-card:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.filter-card.active {
    background-color: var(--primary-color-light);
    color: var(--text-light);
    border-color: var(--primary-color-light);
    box-shadow: 0 4px 12px rgba(34, 15, 255, 0.2);
}

/* Services List */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Service Card */
.service-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 392px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.card-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color-dark);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.status-badge {
    font-size: 1.6rem;
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-weight: 600;
    margin-left: 1rem;
}

.status-badge.active {
    background-color: rgba(0, 230, 118, 0.1);
    color: var(--success-color);
}

.status-badge.inactive,
.status-badge.expired {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
}

.status-badge.draft {
    background-color: var(--draft-color);
    color: #333333;
}

.service-description {
    color: var(--dark);
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    overflow-wrap: break-word;
}

.expiry-info {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.expiry-info strong {
    color: var(--dark-blue);
}

.card-actions {
    margin-top: auto;
}

.edit-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 24px;
    border: none;
    background-color: var(--primary-color-light);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background-color: var(--primary-color);
}

.view-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 24px;
    border: none;
    background-color: var(--secondary-color);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background-color: var(--secondary-color-dark);
}

.delete-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 24px;
    border: none;
    background-color: var(--danger-color, #e74c3c);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 24px;
    border: none;
    background-color: var(--gray);
    color: white;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: var(--danger-color-dark, #c0392b);
}

.toggle-btn:hover {
    background-color: var(--dark-gray);
}

.activate-btn {
    background-color: #29d705;
}

.activate-btn:hover {
    background-color: #22b104;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.card-actions button {
    flex: 1 1 120px;
    min-width: 100px;
}

.card-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.card-actions button:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* No Services Message */
.no-services {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.no-services p {
    color: var(--dark);
    font-size: 1.6rem;
    margin: 0 auto;
    max-width: 500px;
}

.hidden {
    display: none;
}

/* Add Service Button */
.add-service-btn {
    display: inline-flex;
    padding: 1.125rem 2.5rem;
    background-color: var(--secondary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(34, 15, 255, 0.2);
    text-align: center;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    transition: all 0.2s ease;
}

.add-service-btn:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.add-service-btn:active {
    background-color: var(--secondary-color-darker);
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modal Overlay */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

/* Hide by default */
.modal.hidden {
    display: none;
}

/* Modal Container */
.modal-content {
    background-color: #fff;
    padding: 32px;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
    position: relative;
    color: var(--text-light);
}

/* Modal Title */
.modal-content h2 {
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 24px;
    color: var(--text-color);
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 4rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: #333;
    background: #f5f5f5;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group p {
    color: var(--text-color);
}

.input-error {
    color: var(--error-color) !important;
    font-size: 14px;
    margin-top: 4px;
    display: none;
    /* Hidden by default */
}

/* Row Layout for Dual Fields */
.flex-row {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

.flex-row .form-group {
    flex: 1;
}

/* Labels */
.modal-content label {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 6px;
}

/* Inputs, Selects, and Textareas */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select,
.modal-content textarea {
    color: var(--text-color);
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    background-color: #f9f9f9;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.modal-content textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox */
.modal-content input[type="checkbox"] {
    margin-right: 8px;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 3px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

input[type="checkbox"]:checked::after {
    content: "✔";
    background-color: var(--primary-color);
    font-size: 15px;
    position: absolute;
    top: -5px;
    left: 0px;
    color: white;
}

/* Save Button */
#saveEditServiceBtn {
    background-color: var(--primary-color-light);
    color: var(--text-light);
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

#saveEditServiceBtn:hover {
    background-color: var(--primary-color-light);
}

#publishEditServiceBtn {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

#publishEditServiceBtn:hover {
    background-color: var(--secondary-color-dark);
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup.visible {
    opacity: 1;
    visibility: visible;
}

.popup .popup-favorite-icon {
    display: none;
    cursor: pointer;
    width: 24px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.popup-content {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 12px;
    width: 60vw;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.service-popup-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 2rem;
    border-bottom: 1px solid #eee;
    align-items: stretch;
}

.service-popup-footer {
    display: flex;
    justify-content: end;
    padding: 0px 21px;
}

.left-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.right-side {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-direction: column;
}

.service-popup-content {
    padding: 1rem 2rem;
    overflow: auto;
}

.popup-close {
    font-size: 4rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    color: #333;
    background: #f5f5f5;
}

.popup-time-signature {
    font-size: 1.5rem;
    color: #666;
}

.popup-service-title {
    font-size: 2rem;
    color: var(--primary-color-dark);
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
    padding-right: 2rem;
}

.service-popup-scrollable {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 2.5rem;
}

.popup-description {
    font-size: 1.8rem;
    line-height: 1.6;
    color: #444;
    overflow-wrap: break-word;
}

.price-tag {
    background: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
}

.no-price {
    background: var(--primary-color);
}

.popup-about-provider {
    border-radius: 8px;
    margin: 2.5rem 0 1.5rem 0;
    padding: 20px;
    background: #f8f9fa;
}

.provider-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.provider-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    /* border: 2px solid var(--primary-color); */
    display: flex;
    background-color: var(--primary-color-light);
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
}

.provider-type {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.provider-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item.description {
    margin-bottom: 2rem;
}

.provider-category-icon {
    width: 25px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #34495e;
}

.detail-item i {
    color: var(--primary-color);
    width: 20px;
}

.popup-provider-name {
    margin-bottom: 0 !important;
}

.popup-about-provider h3 {
    font-size: 1.8rem;
    color: var(--primary-color-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.popup-about-provider p {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.popup-about-provider strong {
    color: var(--dark-blue);
    font-weight: 600;
}

.popup-provider-name {
    font-weight: 600;
    color: var(--primary-color);
}

.provider-info-icon {
    width: 20px;
}

.provider-location-icon {
    width: 22px;
}

.provider-phone-icon {
    width: 24px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .container {
        width: 92%;
    }

    h1 {
        font-size: 2.4rem;
    }

    .services-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    main {
        padding: 2rem 0;
    }

    h1 {
        font-size: 2rem;
    }

    .filter-cards {
        gap: 0.75rem;
        justify-content: center;
    }

    .filter-card {
        padding: 8px 12px;
        font-size: 1.4rem;
    }

    .service-card {
        padding: 1.5rem;
        min-height: 0;
    }

    .add-service-btn {
        padding: 1rem 2rem;
    }

    .popup-content {
        width: auto;
    }
}

@media (max-width: 480px) {
    .status-badge {
        margin-left: 0;
        margin-top: 0.75rem;
        align-self: flex-start;
    }
}
