/* ========================================
   Hero Header Unified Styles
   Extracted from ac-services.php
   Used across all category pages
======================================== */

:root {
    --hero-primary-blue: #0066FF;
    --hero-bg-color: #FFFFFF;
    --hero-input-bg: #F3F4F6;
    --hero-text-dark: #111827;
    --hero-text-grey: #6B7280;
    --hero-border-color: #E5E7EB;
}

/* App Header */
.app-header {
    padding: 16px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--hero-bg-color);
    /* Added background */
    position: relative;
    /* Ensure z-index works if needed */
    z-index: 10;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--hero-text-dark);
    margin: 0 0 4px;
}

.header-subtitle {
    font-size: 14px;
    color: var(--hero-text-grey);
    margin: 0 0 12px;
}

.location-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--hero-primary-blue);
    font-weight: 500;
    cursor: pointer;
}

.notification-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hero-text-dark);
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
}

/* Search Section */
.search-row {
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    background: var(--hero-input-bg);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 15px;
    color: var(--hero-text-dark);
}

.search-wrapper input::placeholder {
    color: var(--hero-text-grey);
}

.voice-mic {
    color: #6B7280;
    cursor: pointer;
    font-size: 18px;
}

.voice-mic.recording {
    color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.filter-btn-square {
    width: 52px;
    height: 52px;
    background: var(--hero-input-bg);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--hero-text-dark);
}

.filter-btn-square:hover {
    background: #E5E7EB;
}

/* Categories Pills Row */
.categories-row {
    padding: 0 20px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-row::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    background: #F3F4F6;
    color: var(--hero-text-dark);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    background: #E5E7EB;
}

.cat-pill.active {
    background: var(--hero-primary-blue);
    color: white;
}

.cat-pill i {
    font-size: 14px;
}

/* Sub-Service Cards */
.sub-services-row {
    padding: 0 20px 20px;
    display: flex;
    gap: 12px;
}

.sub-card {
    flex: 1;
    height: 80px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #e0e7ff;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sub-card:hover {
    border-color: var(--hero-primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.15);
}

.sub-card.active {
    border-color: var(--hero-primary-blue);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.sub-card-icon {
    font-size: 24px;
    margin-bottom: 4px;
    color: var(--hero-primary-blue);
}

.sub-card span {
    font-size: 11px;
    font-weight: 600;
    color: var(--hero-text-dark);
}

/* Search Results Container */
.search-results-container {
    padding: 0 20px 30px;
    display: none;
}

.search-results-container.active {
    display: block;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.search-results-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--hero-text-dark);
    margin: 0;
}

/* Voice Recording Modal */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.voice-modal.active {
    display: flex;
}

.voice-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 300px;
}

.voice-modal-content i {
    font-size: 48px;
    color: #ef4444;
    animation: pulse 1s infinite;
    margin-bottom: 16px;
}

.voice-modal-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.voice-modal-content p {
    color: var(--hero-text-grey);
    font-size: 14px;
    margin: 0 0 20px;
}

.voice-modal-content button {
    background: var(--hero-primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1C1C1E;
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 9999;
    font-size: 14px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Dark Mode Support */
[data-theme="dark"] .app-header,
.dark-mode .app-header {
    background: #1a1a1a;
}

[data-theme="dark"] .header-left h1,
.dark-mode .header-left h1 {
    color: #fff;
}

[data-theme="dark"] .header-subtitle,
.dark-mode .header-subtitle {
    color: #9CA3AF;
}

[data-theme="dark"] .notification-btn,
.dark-mode .notification-btn {
    background: #2d2d2d;
    border-color: #404040;
    color: #fff;
}

[data-theme="dark"] .search-wrapper,
.dark-mode .search-wrapper {
    background: #2d2d2d;
}

[data-theme="dark"] .search-wrapper input,
.dark-mode .search-wrapper input {
    color: #fff;
}

[data-theme="dark"] .filter-btn-square,
.dark-mode .filter-btn-square {
    background: #2d2d2d;
    color: #fff;
}

[data-theme="dark"] .cat-pill,
.dark-mode .cat-pill {
    background: #2d2d2d;
    color: #fff;
}

[data-theme="dark"] .cat-pill.active,
.dark-mode .cat-pill.active {
    background: var(--hero-primary-blue);
    color: white;
}

[data-theme="dark"] .sub-card,
.dark-mode .sub-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    border-color: #3b82f6;
}

[data-theme="dark"] .sub-card span,
.dark-mode .sub-card span {
    color: #fff;
}

[data-theme="dark"] .voice-modal-content,
.dark-mode .voice-modal-content {
    background: #2d2d2d;
    color: #fff;
}

[data-theme="dark"] .voice-modal-content p,
.dark-mode .voice-modal-content p {
    color: #9CA3AF;
}

/* Responsive */
@media (max-width: 480px) {
    .app-header {
        padding: 12px 16px 0;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .search-row {
        padding: 16px;
    }

    .search-wrapper {
        padding: 12px 14px;
    }

    .filter-btn-square {
        width: 48px;
        height: 48px;
    }

    .categories-row {
        padding: 0 16px;
    }

    .cat-pill {
        padding: 8px 16px;
        font-size: 13px;
    }

    .sub-services-row {
        padding: 0 16px 16px;
        gap: 8px;
    }

    .sub-card {
        height: 70px;
        border-radius: 16px;
    }

    .sub-card-icon {
        font-size: 20px;
    }

    .sub-card span {
        font-size: 10px;
    }
}

/* ========================================
   UX ANIMATIONS & MICRO-INTERACTIONS
======================================== */

/* Entrance Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Apply entrance animations */
.app-header {
    animation: slideInFromTop 0.5s ease-out;
}

.search-row {
    animation: fadeInScale 0.4s ease-out 0.1s both;
}

.categories-row {
    animation: slideInFromLeft 0.5s ease-out 0.2s both;
}

.sub-services-row {
    animation: fadeInScale 0.4s ease-out 0.3s both;
}

/* Enhanced hover effects for notification button */
.notification-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.notification-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.2);
    background: var(--hero-primary-blue);
    color: white;
}

.notification-btn:active {
    transform: scale(0.95);
}

/* Search input focus effects */
.search-wrapper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.search-wrapper:focus-within {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15), 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: scale(1.02);
}

.search-wrapper:focus-within i.fa-search {
    color: var(--hero-primary-blue);
    animation: bounce 0.5s ease;
}

/* Voice mic button effects */
.voice-mic {
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 50%;
}

.voice-mic:hover {
    color: var(--hero-primary-blue);
    background: rgba(0, 102, 255, 0.1);
    transform: scale(1.15);
}

.voice-mic:active {
    transform: scale(0.9);
}

/* Enhanced filter button */
.filter-btn-square {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn-square::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 102, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.filter-btn-square:hover::before {
    width: 100%;
    height: 100%;
}

.filter-btn-square:hover {
    color: var(--hero-primary-blue);
    transform: rotate(15deg);
}

.filter-btn-square:active {
    transform: scale(0.9) rotate(0deg);
}

/* Category pills enhanced effects */
.cat-pill {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* overflow: hidden removed — was clipping label text on mobile */
}

.cat-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cat-pill:hover::before {
    left: 100%;
}

.cat-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cat-pill:active {
    transform: translateY(0) scale(0.98);
}

.cat-pill.active {
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.3);
    animation: fadeInScale 0.3s ease;
}

.cat-pill.active:hover {
    box-shadow: 0 6px 25px rgba(0, 102, 255, 0.4);
}

/* Sub-card enhanced effects */
.sub-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sub-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 102, 255, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-card:hover::after {
    opacity: 1;
}

.sub-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.2);
}

.sub-card:hover .sub-card-icon {
    animation: bounce 0.6s ease;
}

.sub-card:active {
    transform: translateY(-2px) scale(0.98);
}

.sub-card.active {
    animation: fadeInScale 0.3s ease;
}

/* Icon animation */
.sub-card-icon {
    transition: all 0.3s ease;
}

/* Location selector effects */
.location-selector {
    transition: all 0.3s ease;
    padding: 6px 10px;
    border-radius: 8px;
    margin-left: -10px;
}

.location-selector:hover {
    background: rgba(0, 102, 255, 0.08);
    transform: translateX(2px);
}

.location-selector:hover i {
    animation: bounce 0.5s ease;
}

/* Toast animation improvement */
.toast-msg {
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.9);
    }

    70% {
        transform: translateX(-50%) translateY(-5px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Voice modal animation */
.voice-modal {
    backdrop-filter: blur(4px);
}

.voice-modal.active .voice-modal-content {
    animation: modalPopIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Search results animation */
.search-results-container.active {
    animation: fadeInScale 0.3s ease;
}

.search-results-container .service-card-new {
    animation: slideInFromLeft 0.4s ease backwards;
}

.search-results-container .service-card-new:nth-child(1) {
    animation-delay: 0.05s;
}

.search-results-container .service-card-new:nth-child(2) {
    animation-delay: 0.1s;
}

.search-results-container .service-card-new:nth-child(3) {
    animation-delay: 0.15s;
}

.search-results-container .service-card-new:nth-child(4) {
    animation-delay: 0.2s;
}

.search-results-container .service-card-new:nth-child(5) {
    animation-delay: 0.25s;
}

/* Scroll snap for categories */
.categories-row {
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.cat-pill {
    scroll-snap-align: start;
}

/* Loading shimmer effect for skeleton states */
.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth transitions for dark mode */
body,
.app-header,
.search-wrapper,
.cat-pill,
.sub-card,
.notification-btn,
.filter-btn-square {
    transition-property: background-color, color, border-color, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}