.amp-search-widget {
    font-family: 'Tajawal', sans-serif;
    width: 100%;
}

.amp-search-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.amp-search-label {
    color: #24113D;
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
}

.amp-search-field {
    flex: 1 1 auto;
    position: relative;
    min-width: 120px;
}

.amp-search-field select {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid #4B0082;
    border-radius: 12px;
    font-size: 16px;
    color: #24113D;
    background-color: #FFFFFF;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

[dir="rtl"] .amp-search-field select {
    padding: 12px 15px 12px 40px; /* Space for arrow on the left in RTL */
}

[dir="ltr"] .amp-search-field select {
    padding: 12px 40px 12px 15px;
}

.amp-search-field::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #4B0082;
    pointer-events: none;
}

[dir="rtl"] .amp-search-field::after {
    left: 15px;
    right: auto;
}

[dir="ltr"] .amp-search-field::after {
    right: 15px;
    left: auto;
}

.amp-search-field select:disabled {
    background-color: #F8F4FC;
    border-color: #DED9E4;
    color: #999;
    cursor: not-allowed;
}

.amp-search-field select:disabled + ::after {
    border-top-color: #999;
}

.amp-search-field select:focus {
    outline: none;
    border-color: #FF6F00;
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.1);
}

.amp-search-submit-btn {
    background-color: #4B0082;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.amp-search-submit-btn:hover,
.amp-search-submit-btn:focus {
    background-color: #3a0066;
    outline: none;
}

.amp-search-submit-btn:focus {
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.2);
}

.amp-search-submit-btn:active {
    transform: scale(0.98);
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Results */
.amp-search-results-container {
    margin-top: 30px;
}

.amp-search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.amp-search-results-list li {
    background: #FFFFFF;
    border: 1px solid #DED9E4;
    border-radius: 24px;
    transition: box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.amp-search-results-list li:hover {
    box-shadow: 0 8px 24px rgba(36, 17, 61, 0.08);
    border-color: #4B0082;
}

.amp-search-results-list a {
    display: block;
    padding: 20px 24px;
    color: #4B0082;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    height: 100%;
    box-sizing: border-box;
    transition: color 0.2s;
}

.amp-search-results-list a:focus {
    outline: 2px solid #FF6F00;
    outline-offset: -2px;
    border-radius: 24px;
}

/* Show More */
.amp-search-actions {
    text-align: center;
    margin-top: 30px;
}

.amp-search-show-more {
    background: #FFFFFF;
    color: #4B0082;
    border: 2px solid #4B0082;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.2s;
}

.amp-search-show-more:hover {
    background: #4B0082;
    color: #FFFFFF;
}

.amp-search-show-more:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.2);
}

/* Empty State */
.amp-search-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #F8F4FC;
    border-radius: 24px;
    border: 1px solid #DED9E4;
}

.amp-search-empty-state p {
    color: #24113D;
    font-size: 18px;
    margin: 0 0 20px 0;
}

.amp-search-fallback-cta {
    display: inline-block;
    padding: 12px 24px;
    background: #FF6F00;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: background 0.2s;
}

.amp-search-fallback-cta:hover {
    background: #e66400;
}

/* Responsive */
@media (max-width: 768px) {
    .amp-search-controls {
        flex-wrap: wrap;
    }
    .amp-search-field {
        min-width: calc(50% - 100px);
    }
}

@media (max-width: 576px) {
    .amp-search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .amp-search-label {
        margin-bottom: -5px;
        align-self: flex-start;
    }
    .amp-search-submit-btn {
        margin-top: 10px;
        width: 100%;
    }
}
