:root {
    --primary-color: #cabe06;
    --primary-hover: #a89d05;
    --primary-light: #fef3c7;
    --secondary-color: #1e293b;
    --text-main: #334155;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 120px 0 160px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    overflow: hidden;
    margin-bottom: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(202, 190, 6, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(202, 190, 6, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-title span {
    color: var(--primary-color);
}

/* Search Section - Overlapping the Hero */
.search-section {
    position: relative;
    margin-top: -80px;
    z-index: 10;
    padding: 0;
    background: transparent;
    box-shadow: none;
    top: 0;
}

.search-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(8px);
    max-width: 1100px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: 2px solid transparent;
    background: #f1f5f9;
    border-radius: 16px;
    font-size: 1rem;
    color: var(--secondary-color);
    transition: var(--transition-base);
}

.search-input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(202, 190, 6, 0.1);
    outline: none;
}

.price-range-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: var(--transition-base);
}

.price-range-wrapper:focus-within {
    background: #fff;
    border-color: var(--primary-color);
}

.price-input {
    width: 90px;
    border: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.price-input:focus {
    outline: none;
}

.price-sep {
    color: var(--text-muted);
    font-weight: 600;
}

.search-btn {
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 700;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 4px 14px 0 rgba(202, 190, 6, 0.39);
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(202, 190, 6, 0.23);
}

.clear-filter-btn {
    padding: 14px 24px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: var(--text-main);
    font-weight: 600;
    transition: var(--transition-base);
}

.clear-filter-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Tags Container */
.tags-container {
    margin-top: 1.5rem;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
}

.tag-filter {
    padding: 8px 18px;
    background: #f1f5f9;
    color: var(--text-main);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-base);
    border: 1px solid transparent;
}

.tag-filter:hover {
    background: #e2e8f0;
    color: var(--secondary-color);
}

.tag-filter.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(202, 190, 6, 0.2);
}

/* Services Section */
.services-section {
    padding: 100px 0;
    background: var(--bg-light);
}

.section-head {
    margin-bottom: 60px;
    text-align: center;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

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

/* Service Card Refined */
.service-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-base);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(202, 190, 6, 0.2);
}

.service-image-container {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.service-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.service-card:hover .service-image {
    transform: scale(1.08);
}

.service-card-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.service-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-category {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.5rem;
}

.service-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.freelancer-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.freelancer-name-small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.service-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.rating-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: #eab308;
    background: #fefce8;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.85rem;
}

.price-box {
    margin-left: auto;
    text-align: right;
}

.price-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.price-value span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* RTL Specific Fixes */
[dir="rtl"] .search-input-wrapper i {
    left: auto;
    right: 20px;
}

[dir="rtl"] .search-input {
    padding: 16px 52px 16px 20px;
}

[dir="rtl"] .price-box {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .search-container {
        padding: 1rem;
        border-radius: 16px;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper {
        min-width: 100%;
    }

    .price-range-wrapper {
        justify-content: space-between;
    }
}