/**
 * Morocco Tours Engine - Modern Search Widget Styling
 * Beautiful, user-friendly search interface with enhanced UX/UI
 */

/* ====================================================
   Search Widget Container
   ==================================================== */

.mte-search-widget {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mte-search-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mte-primary, #ff5a5f) 0%, var(--mte-accent, #2ecc71) 100%);
}

.mte-search-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* ====================================================
   Widget Title with Heart
   ==================================================== */

.mte-search-widget .mte-widget-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--mte-text-heading, #111827);
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.mte-search-widget .mte-widget-title i {
    font-size: 24px;
    color: var(--mte-primary, #ff5a5f);
    margin-right: 12px;
    animation: heartPulse 2s ease-in-out infinite;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ====================================================
   Form Groups
   ==================================================== */

.mte-search-widget .mte-form-group {
    margin-bottom: 20px;
    position: relative;
}

.mte-search-widget .mte-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--mte-text-heading, #111827);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====================================================
   Input Fields
   ==================================================== */

.mte-search-widget input[type="text"],
.mte-search-widget .mte-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--mte-text-body, #374151);
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.mte-search-widget input[type="text"]:focus,
.mte-search-widget .mte-select:focus {
    outline: none;
    border-color: var(--mte-primary, #ff5a5f);
    box-shadow: 0 0 0 4px rgba(255, 90, 95, 0.1);
    transform: translateY(-1px);
}

.mte-search-widget input[type="text"]:hover,
.mte-search-widget .mte-select:hover {
    border-color: rgba(255, 90, 95, 0.2);
}

.mte-search-widget input[type="text"]::placeholder {
    color: var(--mte-text-muted, #6b7280);
    font-style: italic;
}

/* ====================================================
   Select Dropdown Styling
   ==================================================== */

.mte-search-widget .mte-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.mte-search-widget .mte-select:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff5a5f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* ====================================================
   Submit Button
   ==================================================== */

.mte-search-widget .mte-btn.mte-btn-full {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--mte-primary, #ff5a5f) 0%, #ff3838 100%);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.mte-search-widget .mte-btn.mte-btn-full::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;
}

.mte-search-widget .mte-btn.mte-btn-full:hover::before {
    left: 100%;
}

.mte-search-widget .mte-btn.mte-btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 90, 95, 0.3);
    background: linear-gradient(135deg, #ff3838 0%, #ff2222 100%);
}

.mte-search-widget .mte-btn.mte-btn-full:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 90, 95, 0.25);
}

/* ====================================================
   Loading State
   ==================================================== */

.mte-search-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.mte-search-widget.loading .mte-btn.mte-btn-full {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
}

.mte-search-widget.loading .mte-btn.mte-btn-full::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ====================================================
   Success State
   ==================================================== */

.mte-search-widget.success {
    border-color: var(--mte-accent, #2ecc71);
}

.mte-search-widget.success::before {
    background: linear-gradient(90deg, var(--mte-accent, #2ecc71) 0%, #27ae60 100%);
}

.mte-search-widget.success .mte-btn.mte-btn-full {
    background: linear-gradient(135deg, var(--mte-accent, #2ecc71) 0%, #27ae60 100%);
}

/* ====================================================
   Mobile Responsive
   ==================================================== */

@media (max-width: 768px) {
    .mte-search-widget {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 24px;
    }
    
    .mte-search-widget .mte-widget-title {
        font-size: 18px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .mte-search-widget .mte-widget-title i {
        font-size: 20px;
        margin-right: 10px;
    }
    
    .mte-search-widget .mte-form-group {
        margin-bottom: 16px;
    }
    
    .mte-search-widget .mte-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .mte-search-widget input[type="text"],
    .mte-search-widget .mte-select {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .mte-search-widget .mte-select {
        padding-right: 36px;
        background-size: 10px;
    }
    
    .mte-search-widget .mte-btn.mte-btn-full {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    .mte-search-widget {
        padding: 16px;
        border-radius: 10px;
    }
    
    .mte-search-widget .mte-widget-title {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mte-search-widget .mte-widget-title i {
        font-size: 18px;
        margin-right: 0;
    }
    
    .mte-search-widget input[type="text"],
    .mte-search-widget .mte-select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .mte-search-widget .mte-btn.mte-btn-full {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ====================================================
   Dark Mode Support
   ==================================================== */

@media (prefers-color-scheme: dark) {
    .mte-search-widget {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .mte-search-widget .mte-widget-title {
        color: #ffffff;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .mte-search-widget .mte-form-group label {
        color: #ffffff;
    }
    
    .mte-search-widget input[type="text"],
    .mte-search-widget .mte-select {
        background: #374151;
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .mte-search-widget input[type="text"]::placeholder {
        color: #9ca3af;
    }
    
    .mte-search-widget input[type="text"]:focus,
    .mte-search-widget .mte-select:focus {
        border-color: var(--mte-primary, #ff5a5f);
        box-shadow: 0 0 0 4px rgba(255, 90, 95, 0.2);
    }
    
    .mte-search-widget .mte-select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }
    
    .mte-search-widget .mte-select:hover {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff5a5f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }
}

/* ====================================================
   Accessibility & Focus States
   ==================================================== */

.mte-search-widget input[type="text"]:focus-visible,
.mte-search-widget .mte-select:focus-visible,
.mte-search-widget .mte-btn.mte-btn-full:focus-visible {
    outline: 2px solid var(--mte-primary, #ff5a5f);
    outline-offset: 2px;
}

/* ====================================================
   High Contrast Mode
   ==================================================== */

@media (prefers-contrast: high) {
    .mte-search-widget {
        border-color: #000000;
        border-width: 2px;
    }
    
    .mte-search-widget input[type="text"],
    .mte-search-widget .mte-select {
        border-color: #000000;
        border-width: 2px;
        background: #ffffff;
        color: #000000;
    }
    
    .mte-search-widget .mte-btn.mte-btn-full {
        background: #000000;
        color: #ffffff;
        border: 2px solid #000000;
    }
    
    .mte-search-widget .mte-widget-title i {
        color: #ff0000;
    }
}

/* ====================================================
   Reduced Motion
   ==================================================== */

@media (prefers-reduced-motion: reduce) {
    .mte-search-widget,
    .mte-search-widget .mte-widget-title i,
    .mte-search-widget input[type="text"],
    .mte-search-widget .mte-select,
    .mte-search-widget .mte-btn.mte-btn-full {
        transition: none;
        animation: none;
    }
    
    .mte-search-widget .mte-widget-title i {
        animation: none;
    }
    
    .mte-search-widget .mte-btn.mte-btn-full::before {
        display: none;
    }
}

/* ====================================================
   Print Styles
   ==================================================== */

@media print {
    .mte-search-widget {
        display: none !important;
    }
}
