/* Hero Results Counter */
.hero .results-header,
.filter-bar {
    margin-top: 2rem;
    text-align: center;
    font-size: 1.6rem;
    color: var(--dark);
    font-weight: 500;
    background-color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero .results-header span {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.8rem;
}

/* Browse Categories */
.browse-categories {
    padding: 2rem 1.5rem 4rem;
    background-color: #fff;
}

.section-title {
    text-align: center;
    font-size: 3.6rem;
    margin-bottom: 4rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
}

.category-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: white;
    border: 1px white solid;
    border-radius: 1.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 1.6rem;
    color: var(--text-color);
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

.category-card:hover {
    border: 1px solid var(--primary-color);
    /* background-color: var(--accent-color);
    color: #000; */
}

/* Service Cards */
.services-container {
    padding: 2rem 1.5rem;
    background: var(--gradient-primary);
}

.filter-bar {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.filter-bar label {
    cursor: pointer;
}

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;
    margin-right: 8px;
    margin-bottom: -2px;
}

input[type="checkbox"]:checked::after {
    content: "✔";
    background-color: var(--primary-color);
    font-size: 15px;
    position: absolute;
    top: -5px;
    left: 0px;
    color: white;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    cursor: pointer;
    background-color: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
    width: 60vw;
    max-width: 1200px;
    margin: auto;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.card-header-right {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    /* align-self: self-end; */
    flex-direction: column;
}

.service-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.price-tag-card,
.price-request-card {
    background: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.price-request-card {
    background: var(--primary-color);
}

.service-card .card-favorite-icon {
    position: absolute;
    right: 0px;
    top: 5px;
    width: 24px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.service-card h2 {
    font-size: 1.8rem;
    color: var(--primary-color-dark);
    margin-right: 2rem !important;
}

.service-card p {
    font-size: 1.4rem;
    color: var(--text-color);
    overflow-wrap: break-word;
}

.badges {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.badge {
    background-color: var(--primary-color-light);
    color: white;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 999px;
}

.badge.national {
    background-color: var(--secondary-color);
}

.provider-line {
    font-size: 14px;
    color: var(--dark);
}

.provider-line.fizica strong {
    color: var(--success-color);
}

.provider-line.juridica strong {
    color: var(--secondary-color-dark);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

#showMoreBtn {
    display: block;
    margin: 2rem auto 0;
    padding: 0.8rem 1.6rem;
    background-color: var(--primary-color-light);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#showMoreBtn:hover {
    background-color: var(--primary-color);
}

#showMoreBtn:active {
    transform: scale(0.98);
}

/* 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;
    align-items: stretch;
    gap: 15px;
    padding: 2rem;
    border-bottom: 1px solid #eee;
    flex-direction: column;
}

.left-side {
    display: flex;
    flex-direction: row;
    gap: 3px;
    align-items: flex-start;
    justify-content: space-between;
}

.top-right-icons {
    display: flex;
    gap: 1rem;
}

.right-side {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.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;
    text-align: right;
}

.popup-service-title {
    font-size: 2rem;
    color: var(--primary-color-dark);
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
}

.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 {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #34495e;
}

.popup-provider-description {
    margin-bottom: 2rem;
}

.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;
}

.popup-actions {
    display: flex;
    gap: 0.8rem;
    background: white;
    padding: 2rem;
    border-top: 1px solid #eee;
    z-index: 2;
}

.popup-action-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    align-content: center;
    text-align: center;
    padding: 0.8rem 1.2rem;
    border-radius: 2.5rem;
    font-size: 1.6rem;
    font-weight: 600;
    min-height: 5rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-action-btn img {
    width: 22px;
    height: 22px;
}

.phone-btn img {
    width: 22px;
    height: 22px;
    margin: 0 5px -5px 0;
}

.whatsapp-btn img {
    width: 22px;
    height: 22px;
    margin: 0 2px -4px 0;
}

.telegram-btn img {
    margin: 0 4px -5px 0;
}

.share-btn img {
    margin: 0 4px -4px 0;
}

.report-btn img {
    margin: 0 0px -4px 0;
}

.popup-action-btn span {
    font-size: 1.6rem;
}

/* Specific button styles */
.phone-btn {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 15, 255, 0.2);
}

.phone-btn:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.phone-btn:active {
    background-color: var(--secondary-color-darker);
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.whatsapp-btn {
    background-color: #25d366;
    color: white;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.2);
}

.whatsapp-btn:hover {
    background-color: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.whatsapp-btn:active {
    background-color: #1ebe55;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.telegram-btn {
    background-color: #0088cc;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.2);
}

.telegram-btn:hover {
    background-color: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.telegram-btn:active {
    background-color: #006699;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-btn {
    background-color: #9b59b6;
    color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.share-btn:hover {
    background-color: #884ea0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.share-btn:active {
    background-color: #7d3c98;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.report-btn {
    background-color: var(--error-color);
    border: 1px solid #e0e0e0;
    color: white;
}

.report-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.report-btn:active {
    background-color: #a93226;
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.unavailable-popup {
    justify-items: center;
    text-align: center;
    width: fit-content;
}

#XInactiveServicePopupButton {
    top: -14px;
    right: -14px;
}

.unavailable-popup .popup-title {
    font-size: 1.5em;
    color: var(--dark-blue);
}

.unavailable-popup .popup-actions {
    justify-content: center;
}

.unavailable-popup .popup-description {
    color: #555;
    padding: 26px 42px;
    border-top: 1px solid #eee;
}

.unavailable-popup .service-popup-header {
    padding: 1.6rem;
}

.unavailable-popup .popup-actions {
    padding: 0 0 1.6rem 0;
    border-top: none;
}

.unavailable-popup .close-btn {
    padding: 0.8rem 1.6rem;
    background-color: var(--secondary-color);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    font-size: 1.6rem;
    transition: all 0.2s ease;
}

.unavailable-popup .close-btn:hover {
    background-color: var(--secondary-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.unavailable-popup .close-btn:active {
    background-color: var(--secondary-color-darker);
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.unavailable-popup-header {
    display: flex;
    justify-content: flex-end;
    margin: 10px 8px -10px 0;
}

/* Responsive Tweaks */
@media (max-width: 768px) {
    .provider-details {
        display: flex;
        flex-direction: column;
    }

    .popup-about-provider {
        overflow-wrap: anywhere;
    }

    .popup-action-btn span {
        display: none;
    }

    .service-card,
    .popup-content {
        width: -webkit-fill-available;
    }

    .service-card .card-favorite-icon {
        width: 22px;
    }

    .category-card {
        padding: 2rem;
    }

    .popup-actions {
        text-align: center;
    }

    .service-popup-scrollable {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 450px) {
    .top-right-icons {
        margin-right: 1.6rem;
    }
}