/**
 * Armex Archive Search Form Styles - Mobile First
 */

/* Mobile First Base Styles */
.armex-search-form-container {
    max-width: 800px;
    margin: 0 1rem 1.5rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.armex-search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.armex-archive-search-form {
	margin-bottom: 3rem;
}

.armex-archive-search-form  .filetree__filter__btn-wrap button {
	margin-left: 10px;
	margin-right: 10px;
}

.search-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-label {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Image Selection Groups - Mobile First */
.image-selection-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.image-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 180px;
    text-align: center;
}

.image-option:hover,
.image-option.hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.12);
}

.image-option.active {
    border-color: #1d4ed8;
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.image-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    transition: all 0.3s ease;
}

.image-option:hover .image-wrapper,
.image-option.hover .image-wrapper {
    background: #dbeafe;
}

.image-option.active .image-wrapper {
    background: rgba(255, 255, 255, 0.2);
}

.option-icon {
    width: 26px;
    height: 26px;
    stroke-width: 2;
    color: #6b7280;
    transition: color 0.3s ease;
}

.image-option:hover .option-icon,
.image-option.hover .option-icon {
    color: #3b82f6;
}

.image-option.active .option-icon {
    color: #ffffff;
}

.option-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    transition: color 0.3s ease;
}

.image-option:hover .option-label,
.image-option.hover .option-label {
    color: #1d4ed8;
}

.image-option.active .option-label {
    color: #ffffff;
}

/* Product Name Input - Mobile First */
.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px; /* Prevent zoom on iOS */
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Submit Button Group - Mobile First */
.submit-group {
    align-items: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.search-submit-btn, .search-reset-btn {
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 48px;
    width: 100%;
    max-width: 280px;
}

.search-submit-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

.search-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.search-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.search-reset-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
}

.search-reset-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(75, 85, 99, 0.25);
}

/* Loading Animation */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

/* Rate Limit Message */
.rate-limit-message {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
}

.rate-limit-text {
    color: #92400e;
    font-weight: 600;
}

/* Search Error Messages */
.search-error-message {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
}

.search-error-message .armex-archive-no-files {
    color: #dc2626;
    font-weight: 600;
    margin: 0;
}

/* Progressive Enhancement for Larger Screens */

/* Small screens (480px and up) */
@media (min-width: 480px) {
    .armex-search-form-container {
        margin: 0 1.5rem 2rem;
        padding: 1.25rem;
        border-radius: 10px;
    }

    .armex-search-form {
        gap: 1.75rem;
    }

    .search-group {
        gap: 1rem;
    }

    .image-selection-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .image-option {
        width: auto;
        min-width: 140px;
        max-width: none;
        padding: 1.25rem 1.75rem;
        gap: 0.625rem;
    }

    .image-wrapper {
        width: 52px;
        height: 52px;
    }

    .option-icon {
        width: 28px;
        height: 28px;
    }

    .option-label {
        font-size: 0.95rem;
    }

    .button-group {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .search-submit-btn, .search-reset-btn {
        width: auto;
        max-width: none;
        padding: 1rem 2.25rem;
    }
}

/* Medium screens (768px and up) */
@media (min-width: 768px) {
    .armex-search-form-container {
        margin: 0 auto 2rem;
        padding: 1.75rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .armex-search-form {
        gap: 2rem;
    }

    .search-label {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .image-selection-group {
        gap: 1.5rem;
    }

    .image-option {
        padding: 1.5rem 2rem;
        min-width: 120px;
        border-radius: 12px;
        gap: 0.75rem;
    }

    .image-option:hover,
    .image-option.hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    }

    .image-option.active {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
    }

    .image-wrapper {
        width: 60px;
        height: 60px;
    }

    .option-icon {
        width: 32px;
        height: 32px;
    }

    .option-label {
        font-size: 1rem;
    }

    .search-input {
        padding: 1rem 1.25rem;
        border-radius: 8px;
        font-size: 1rem;
    }

    .search-submit-btn, .search-reset-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
        border-radius: 8px;
        min-height: 56px;
    }

    .search-submit-btn:hover:not(:disabled) {
        box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
    }

    .search-reset-btn:hover {
        box-shadow: 0 8px 25px rgba(75, 85, 99, 0.3);
    }
}

@media (min-width: 1005px) {
	.armex-archive-search-form .filetree__filter__col:nth-child(1) {
		width: 180px;
		flex: 1;
	}

	.armex-archive-search-form .filetree__filter__col:nth-child(2) {
		width: 180px;
		flex: 1;
	}

	.armex-archive-search-form .filetree__filter__col:nth-child(3) {
		width: auto;
		flex: 2;
	}
}
