/* Advanced Search Page Specific Styles */

/* Page Header - Hidden on advanced search page */
body .page-header {
    display: none !important;
}

/* Form Header Title */
.form-header-title {
    margin-bottom: 0.2rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-image: url('../images/visuals/1.png');
    background-size: 20px 20px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.02;
    z-index: 0;
}

.page-title-section {
    position: relative;
    z-index: 1;
}

.form-header-title .page-title {
    color: #2F2D69;
    font-size: 0.51rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    padding: 0.15rem 0;
}

.page-subtitle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    color: #666;
    font-size: 0.47rem;
    font-weight: 500;
}

.search-icon {
    font-size: 0.82rem;
}

.more-details-link {
    position: relative;
    z-index: 1;
}

.more-details-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.68rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.8);
    border: 1px solid #e9ecef;
}

.more-details-btn:hover {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
    border-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.2);
}

.details-icon {
    color: #d32f2f;
    font-size: 0.82rem;
}

.advanced-search-form-container {
    background: white;
    border-radius: 3px;
    padding: 0.2rem;
    margin-bottom: 0.2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.advanced-search-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-image: url('../images/visuals/2.png');
    background-size: 18px 18px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.02;
    z-index: 0;
}

.advanced-search-form {
    position: relative;
    z-index: 1;
}

.form-section {
    margin-bottom: 0.15rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    color: #2F2D69;
    font-size: 0.44rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    padding: 0.15rem 0.3rem;
    background: linear-gradient(135deg, #2F2D69, #1AAB9E);
    color: white;
    border-radius: 2px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(47, 45, 105, 0.1);
    position: relative;
    overflow: hidden;
}

.form-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/visuals/3.png');
    background-size: 15px 15px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.05;
    z-index: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.2rem;
    margin-top: 0.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.41rem;
    margin-bottom: 0.08rem;
    padding-right: 0.05rem;
}

.form-group input,
.form-group select {
    padding: 0.2rem 0.3rem;
    border: 1px solid #e9ecef;
    border-radius: 2px;
    font-size: 0.41rem;
    font-family: 'Farhang', sans-serif;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
    line-height: 1.2;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1AAB9E;
    box-shadow: 0 0 0 3px rgba(26, 171, 158, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1rem;
    padding-left: 3rem;
}

.form-submit-section {
    text-align: center;
    margin-top: 0.2rem;
    padding-top: 0.15rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.search-submit-btn {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    font-size: 0.44rem;
    font-weight: 600;
    font-family: 'Farhang', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(25, 118, 210, 0.1);
    position: relative;
    overflow: hidden;
    line-height: 1.2;
}

.search-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
}

.search-submit-btn:hover::before {
    left: 100%;
}

.search-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.page-footer {
    text-align: right;
    margin-top: 0.5rem;
    padding: 0.4rem 0;
}

.page-indicator {
    color: #28a745;
    font-weight: 600;
    font-size: 0.51rem;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

/* Advanced Search Form Additional Styles */
.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input.success,
.form-group select.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group input.focused,
.form-group select.focused {
    border-color: #1AAB9E;
    box-shadow: 0 0 0 3px rgba(26, 171, 158, 0.15);
}

.field-error {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.char-counter {
    transition: color 0.3s ease;
}

.clear-form-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.clear-form-btn:active {
    transform: translateY(0);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

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

/* Form section animations */
.form-section {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for form groups */
.form-group {
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }

/* Enhanced select styling */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1rem;
    padding-left: 3rem;
}

.form-group select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231AAB9E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Enhanced button styling */
.search-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-submit-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

/* Enhanced input styling */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

/* Responsive Design for Advanced Search */
@media (max-width: 1024px) {
    .page-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 0.82rem;
    }
    
    .advanced-search-form-container {
        padding: 0.5rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.4rem;
    }
    
    .form-section-title {
        font-size: 0.51rem;
        padding: 0.3rem 0.4rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 0.75rem;
    }
    
    .page-subtitle {
        justify-content: center;
        font-size: 0.51rem;
    }
    
    .advanced-search-form-container {
        padding: 0.5rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    
    .form-section {
        margin-bottom: 0.6rem;
        padding-bottom: 0.5rem;
    }
    
    .form-section-title {
        font-size: 0.51rem;
        padding: 0.3rem 0.4rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.4rem 0.5rem;
        font-size: 0.47rem;
    }
    
    .search-submit-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.51rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 0.4rem;
    }
    
    .page-title {
        font-size: 0.68rem;
    }
    
    .page-subtitle {
        font-size: 0.47rem;
    }
    
    .more-details-btn {
        font-size: 0.47rem;
        padding: 0.2rem 0.4rem;
    }
    
    .advanced-search-form-container {
        padding: 0.4rem;
    }
    
    .form-section-title {
        font-size: 0.47rem;
        padding: 0.25rem 0.4rem;
    }
    
    .form-group label {
        font-size: 0.44rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.3rem 0.4rem;
        font-size: 0.47rem;
    }
    
    .search-submit-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.47rem;
        width: 100%;
    }
    
    .page-indicator {
        font-size: 0.47rem;
        padding: 0.2rem 0.4rem;
    }
}
